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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 16:32:32 PST 2020


dblaikie 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) {
----------------
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? 


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