Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,17 @@ Expected<DWARFAddressRangesVector> DWARFDie::getAddressRanges() const {
return DWARFAddressRangesVector{{LowPC, HighPC, Index}};

std::optional<DWARFFormValue> Value = find(DW_AT_ranges);
if (Value) {
if (Value->getForm() == DW_FORM_rnglistx)
return U->findRnglistFromIndex(*Value->getAsSectionOffset());
return U->findRnglistFromOffset(*Value->getAsSectionOffset());
}
return DWARFAddressRangesVector();
if (!Value)
return DWARFAddressRangesVector();

std::optional<uint64_t> SecOff = Value->getAsSectionOffset();
if (!SecOff)
return DWARFAddressRangesVector();

if (Value->getForm() == DW_FORM_rnglistx)
return U->findRnglistFromIndex(*SecOff);

return U->findRnglistFromOffset(*SecOff);
}

bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const {
Expand Down
Loading