[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
Wed Feb 5 08:03:12 PST 2020


jhenderson marked an inline comment as done.
jhenderson added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:644-647
           // Assume that the line table is correct and temporarily override the
-          // address size.
-          DebugLineData.setAddressSize(Len - 1);
-          State.Row.Address.Address = DebugLineData.getRelocatedAddress(
-              OffsetPtr, &State.Row.Address.SectionIndex);
-
-          // Restore the address size if the extractor already had it.
-          if (ExtractorAddressSize != 0)
-            DebugLineData.setAddressSize(ExtractorAddressSize);
+          // address size. If the size is unsupported, give up trying to read
+          // the address and continue to the next opcode.
+          if (OpcodeAddressSize != 4 && OpcodeAddressSize != 8) {
----------------
dblaikie wrote:
> I'd generally like to assume that the /first/ time a value/field/length/etc is seen, that is correct and anything later that conflicts with it is incorrect.
> 
> In what cases would we reach here anyway? Could we check earlier and ensure the extractor has a meaningful (non-zero) address size? 
(oops, Phabricator is showing my reply above your one @dblaikie)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73962/new/

https://reviews.llvm.org/D73962





More information about the llvm-commits mailing list