summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2018-11-14 11:12:40 +0000
committerPavel Labath <pavel@labath.sk>2018-11-14 11:12:40 +0000
commit18e98645014feb187c11c87b5bd291641e31afc5 (patch)
treed07e2fe452c3d234b642500cdcc1ab15b90fb368 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parent98963db57d04d38f154ca37b9c8c768da1697222 (diff)
downloadbcm5719-llvm-18e98645014feb187c11c87b5bd291641e31afc5.tar.gz
bcm5719-llvm-18e98645014feb187c11c87b5bd291641e31afc5.zip
Fix a crash when parsing incorrect DWARF
Summary: While parsing a childless compile unit DIE we could crash if the DIE was followed by any extra data (such as a superfluous end-of-children marker). This happened because the break-on-depth=0 check was performed only when parsing the null DIE, which was not correct because with a childless root DIE, we could reach the end of the unit without ever encountering the null DIE. If the compile unit contribution ended directly after the CU DIE, everything would be fine as we would terminate parsing due to reaching EOF. However, if the contribution contained extra data (perhaps a superfluous end-of-children marker), we would crash because we would treat that data as the begging of another compile unit. This fixes the crash by moving the depth=0 check to a more generic place, and also adds a regression test. Reviewers: clayborg, jankratochvil, JDevlieghere Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D54417 llvm-svn: 346849
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud