summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-12-01 18:25:30 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-12-01 18:25:30 +0000
commit89e6e155520847b5d27bfaf6f0c699e46cfec771 (patch)
treea957f646372a738ad6495b263131544c19d33996 /lib/DebugInfo
parent53cc245050ab02a1f2373f8b488a73b78f218761 (diff)
[DebugInfo] Bail out if making no progress dumping line tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARF/DWARFContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp
index 5893f223c07..414959c7a5c 100644
--- a/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -357,12 +357,16 @@ void DWARFContext::dump(
// Verbose dumping is done during parsing and not on the intermediate
// representation.
OS << "debug_line[" << format("0x%8.8x", Offset) << "]\n";
+ unsigned OldOffset = Offset;
if (DumpOpts.Verbose) {
LineTable.parse(LineData, &Offset, U, &OS);
} else {
LineTable.parse(LineData, &Offset, U);
LineTable.dump(OS);
}
+ // Check for unparseable prologue, to avoid infinite loops.
+ if (OldOffset == Offset)
+ break;
}
}