[PATCH] D54049: [DWARF v5] Verifier: Add checks for DW_FORM_strx* forms.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 14:50:00 PDT 2018


probinson added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:643
+    Optional<uint64_t> StringOffset = DieCU->getStringOffsetSectionItem(Index);
+    assert(StringOffset); // Guaranteed to succeed at this point.
+    if (*StringOffset >= DObj.getStringSection().size()) {
----------------
aprantl wrote:
> I'm pretty sure Optional::operator* already asserts.
In which case this could simplify to
```
uint64_t StringOffset = *DieCU->getStringOffsetSectionItem(Index);
if (StringOffset >= ...
```


https://reviews.llvm.org/D54049





More information about the llvm-commits mailing list