[PATCH] D35444: [DWARF] Modification of code for the verification of .debug_info section.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 08:23:24 PDT 2017


aprantl added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:94
+    const auto Tag = Die.getTag();
+    if (Tag == DW_TAG_null)
+      continue;
----------------
Since Tag isn't used anywhere else:
`if (Die.getTag() == DW_TAG_null)`


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:101
+  }
+  return NumDebugInfoErrors == 0;
+}
----------------
It looks like this might also return false if the unit is correct, but there were previous errors? Is that what we want here?


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:141
+      case dwarf::DW_UT_partial:
+      default: {
+        DWARFUnitSection<DWARFCompileUnit> CUSection{};
----------------
I think it might be better to handle the default: case separately and have it produce a verification error.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:162
+  verifyDebugInfoReferences();
+  return (Success && NumDebugInfoErrors == 0);
 }
----------------
Same point applies as in line 101, though here it looks more like this is intentional.


https://reviews.llvm.org/D35444





More information about the llvm-commits mailing list