We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
std::optional<>
1 parent 0b344b4 commit dbb1ca2Copy full SHA for dbb1ca2
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -394,9 +394,13 @@ Expected<DWARFAddressRangesVector> DWARFDie::getAddressRanges() const {
394
395
std::optional<DWARFFormValue> Value = find(DW_AT_ranges);
396
if (Value) {
397
+ std::optional<uint64_t> SecOff = Value->getAsSectionOffset();
398
+ if (!SecOff) {
399
+ return DWARFAddressRangesVector();
400
+ }
401
if (Value->getForm() == DW_FORM_rnglistx)
- return U->findRnglistFromIndex(*Value->getAsSectionOffset());
- return U->findRnglistFromOffset(*Value->getAsSectionOffset());
402
+ return U->findRnglistFromIndex(*SecOff);
403
+ return U->findRnglistFromOffset(*SecOff);
404
}
405
return DWARFAddressRangesVector();
406
0 commit comments