summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
index 4b844e999eb..50283b40ca8 100644
--- a/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
+++ b/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
@@ -92,7 +92,13 @@ void DWARFAcceleratorTable::dump(raw_ostream &OS) {
OS << " Invalid section offset\n";
continue;
}
- while (unsigned StringOffset = AccelSection.getU32(&DataOffset)) {
+ while (AccelSection.isValidOffsetForDataOfSize(DataOffset, 4)) {
+ unsigned StringOffset = AccelSection.getU32(&DataOffset);
+ RelocAddrMap::const_iterator Reloc = Relocs.find(DataOffset-4);
+ if (Reloc != Relocs.end())
+ StringOffset += Reloc->second.second;
+ if (!StringOffset)
+ break;
OS << format(" Name: %08x \"%s\"\n", StringOffset,
StringSection.getCStr(&StringOffset));
unsigned NumData = AccelSection.getU32(&DataOffset);
OpenPOWER on IntegriCloud