[PATCH] D34359: [DWARF] Verification of the validity of the hash data offset and hash data DIEs in the the .apple_names section.
Frederic Riss via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 13:24:11 PDT 2017
friss added a comment.
Some more comments:
================
Comment at: include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h:58
uint32_t getHeaderDataLength();
+ uint32_t getNumAtoms();
+ ArrayRef<std::pair<HeaderData::AtomType, HeaderData::Form>> getAtomsDesc();
----------------
you don't really need this, you can do getAtomsDesc().size();
================
Comment at: lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp:75-76
+
+ for (auto it = this->getAtomsDesc().begin(); it != this->getAtomsDesc().end();
+ ++it) {
+ DWARFFormValue FormValue(it->second);
----------------
```
for (auto Atom : getAtomDesc()) {
AtomType Type = Atom.first;
Form Form = Atom.second;
...
```
================
Comment at: lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp:82
+ case dwarf::DW_ATOM_die_offset:
+ DieOffset = *FormValue.getAsUnsignedConstant();
+ break;
----------------
Either you add a check here that the Optional is populated, or you check before iterating that the description of the die_offset has a form that can be decoded by getAsUnsignedConstant(). As written this can crash.
https://reviews.llvm.org/D34359
More information about the llvm-commits
mailing list