diff options
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp b/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp index e2dc9d5b76d..4afcdf189f2 100644 --- a/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp +++ b/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp @@ -610,11 +610,12 @@ void CVSymbolDumperImpl::visitDefRangeSym(SymbolKind Kind, if (ObjDelegate) { StringRef StringTable = ObjDelegate->getStringTable(); - if (!StringTable.empty()) { - W.printString( - "Program", - StringTable.drop_front(DefRange.Header.Program).split('\0').first); - } + auto ProgramStringTableOffset = DefRange.Header.Program; + if (ProgramStringTableOffset >= StringTable.size()) + return parseError(); + StringRef Program = + StringTable.drop_front(ProgramStringTableOffset).split('\0').first; + W.printString("Program", Program); } printLocalVariableAddrRange(DefRange.Header.Range, DefRange.getRelocationOffset()); |