[PATCH] D73618: [DebugInfo] Check that we do not run past a line table end when parsing

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 03:43:13 PST 2020


jhenderson created this revision.
jhenderson added reviewers: dblaikie, JDevlieghere, ikudrin, probinson, MaskRay.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This change adds another check to the debug line table parsing code, namely to make sure the final offset after parsing a table matches the end offset as expected based on the unit length field. These two won't match if the unit length points to part way through an opcode, as the parsing does not stop midway through opcodes.

If the problem is detected, the offset will be reset to the expected value and an error reported.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73618

Files:
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  llvm/test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s
  llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
  llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
  llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73618.241098.patch
Type: text/x-patch
Size: 9971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200129/6ef98b05/attachment.bin>


More information about the llvm-commits mailing list