[PATCH] D35963: [DWARF] Added verification check for tags in accelerator tables. This patch verifies that the atom tag is actually the same with the tag of the DIE that we retrieve from the table.

Spyridoula Gravani via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 10:13:07 PDT 2017


sgravani added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp:102
+    case dwarf::DW_ATOM_die_tag:
+      DieTag = (dwarf::Tag)*FormValue.getAsUnsignedConstant();
+      break;
----------------
aprantl wrote:
> A dwarf::Tag is a uint_16 — do we also need to check that the value is within range, or is this impossible because we already verified the FORM?
I think we will catch such an error when we validate the forms


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:550
 
           ++NumErrors;
+        } else if ((std::get<1>(Atoms) != dwarf::DW_TAG_null) &&
----------------
aprantl wrote:
> maybe `continue;` here and get rid of the else? not sure if this will be better :-)
.....why do that? I'm not sure if this is better either :P


https://reviews.llvm.org/D35963





More information about the llvm-commits mailing list