[PATCH] D73962: [DebugInfo] Error if unsupported address size detected in line table

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 06:23:43 PST 2020


jhenderson created this revision.
jhenderson added reviewers: ikudrin, JDevlieghere, dblaikie, probinson.
Herald added subscribers: hiraditya, aprantl.
Herald added a project: LLVM.
jhenderson marked an inline comment as done.
jhenderson added inline comments.
jhenderson edited the summary of this revision.
jhenderson added a parent revision: D73901: [DebugInfo][test] Fix calculation of generated line table size.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:635
           uint8_t ExtractorAddressSize = DebugLineData.getAddressSize();
-          if (ExtractorAddressSize != Len - 1 && ExtractorAddressSize != 0)
+          // FIXME: Check to make sure Len <= sizeof(uint8_t).
+          uint8_t OpcodeAddressSize = Len - 1;
----------------
I'm going to write a follow-up patch for this issue.


Prior to this patch, if a DW_LNE_set_address opcode was parsed with an address size (i.e. with a length after the opcode) of anything other 1, 2, 4, or 8, an llvm_unreachable would be hit, as the data extractor does not support other values. This patch introduces a new error check that verifies the address size is 4 or 8, in common with other places within the DWARF parsing.

Depends on D73901 <https://reviews.llvm.org/D73901>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73962

Files:
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73962.242314.patch
Type: text/x-patch
Size: 5358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200204/ed2819ad/attachment.bin>


More information about the llvm-commits mailing list