projects
/
pyelftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1dfadfe
)
Issue #7: be more forgiving to incorrect DWARF that has extra NULLs in DIE trees
author
Eli Bendersky
<eliben@gmail.com>
Sun, 6 Jan 2013 14:09:57 +0000
(06:09 -0800)
committer
Eli Bendersky
<eliben@gmail.com>
Sun, 6 Jan 2013 14:09:57 +0000
(06:09 -0800)
elftools/dwarf/compileunit.py
patch
|
blob
|
history
diff --git
a/elftools/dwarf/compileunit.py
b/elftools/dwarf/compileunit.py
index fbe4a8b302282373cfeeee3024b44543eaf794c5..f7acaab89b2362c53dbf40fa4f280d80aeb15d2e 100644
(file)
--- a/
elftools/dwarf/compileunit.py
+++ b/
elftools/dwarf/compileunit.py
@@
-143,6
+143,11
@@
class CompileUnit(object):
if die.has_children:
parentstack.append(die)
else:
- # end of children for the current parent
- parentstack.pop()
+ # parentstack should not be really empty here. However, some
+ # compilers generate DWARF that has extra NULLs in the end and
+ # we don't want pyelftools to fail parsing them just because of
+ # this.
+ if len(parentstack) > 0:
+ # end of children for the current parent
+ parentstack.pop()