This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwarfdump] Avoid crashing if an abbreviation offset is invalid.
ClosedPublic

Authored by ikudrin on Aug 11 2020, 8:37 AM.

Details

Summary

Note that DWARFUnit::getAbbreviations() returns nullptr if the abbreviations could not be read, but callers used the returned pointer without checking.

Diff Detail

Event Timeline

ikudrin created this revision.Aug 11 2020, 8:37 AM
ikudrin requested review of this revision.Aug 11 2020, 8:37 AM
dblaikie accepted this revision.Aug 11 2020, 11:23 AM

Sounds good, thanks!

This revision is now accepted and ready to land.Aug 11 2020, 11:23 AM
MaskRay added inline comments.Aug 11 2020, 4:58 PM
llvm/test/tools/llvm-dwarfdump/X86/debug_info_invalid_abbrev_offset.s
1 ↗(On Diff #284755)

Would it help if the two files are grouped in one invalid_abbrev_offset.s?

ikudrin added inline comments.Aug 11 2020, 11:57 PM
llvm/test/tools/llvm-dwarfdump/X86/debug_info_invalid_abbrev_offset.s
1 ↗(On Diff #284755)

OK, I'll merge the tests on commit.