summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
index 6e8cbcad491..17f17572a30 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
@@ -165,9 +165,12 @@ DWARFUnitIndex::Entry::getOffset() const {
const DWARFUnitIndex::Entry *
DWARFUnitIndex::getFromOffset(uint32_t Offset) const {
for (uint32_t i = 0; i != Header.NumBuckets; ++i)
- if (const auto &Contribs = Rows[i].Contributions)
- if (Contribs[InfoColumn].Offset == Offset)
+ if (const auto &Contribs = Rows[i].Contributions) {
+ const auto &InfoContrib = Contribs[InfoColumn];
+ if (InfoContrib.Offset <= Offset &&
+ Offset < (InfoContrib.Offset + InfoContrib.Length))
return &Rows[i];
+ }
return nullptr;
}
OpenPOWER on IntegriCloud