Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perf-instrumentation
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
safedocs-ta2-profiling
perf-instrumentation
Commits
f81c101b
Commit
f81c101b
authored
2 years ago
by
pompolic
Browse files
Options
Downloads
Patches
Plain Diff
Don't allow initialization with address of 0x0
parent
26a2fa61
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gdb-port/ast.py
+4
-0
4 additions, 0 deletions
gdb-port/ast.py
with
4 additions
and
0 deletions
gdb-port/ast.py
+
4
−
0
View file @
f81c101b
...
@@ -4,6 +4,8 @@ class HParseResult:
...
@@ -4,6 +4,8 @@ class HParseResult:
def
__init__
(
self
,
address
):
def
__init__
(
self
,
address
):
# Note to self: Address has to be an integer and not string
# Note to self: Address has to be an integer and not string
# Otherwise all hell breaks loose
# Otherwise all hell breaks loose
if
address
==
0
:
raise
ValueError
(
"
Nullpointer given as address of HParseResult
"
)
self
.
address
=
address
self
.
address
=
address
# Mostly for convenience
# Mostly for convenience
self
.
has_ast
=
self
.
read_AST_not_null
()
self
.
has_ast
=
self
.
read_AST_not_null
()
...
@@ -71,6 +73,8 @@ class HParsedToken:
...
@@ -71,6 +73,8 @@ class HParsedToken:
# The former will allocate an char[] and cast it to a HParsedToken* when reading members
# The former will allocate an char[] and cast it to a HParsedToken* when reading members
if
isinstance
(
address
,
str
):
if
isinstance
(
address
,
str
):
print
(
"
Warning: Address % given to HParsedToken is a string. This is probably an error (expecting int or gdb.Value)
"
%
address
)
print
(
"
Warning: Address % given to HParsedToken is a string. This is probably an error (expecting int or gdb.Value)
"
%
address
)
if
address
==
0
:
raise
ValueError
(
"
Nullpointer given as address of HParsedToken
"
)
self
.
address
=
address
self
.
address
=
address
# Unused for now
# Unused for now
self
.
parent
=
parent
self
.
parent
=
parent
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment