Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -485,10 +485,13 @@ auto FileBuffer = SourceCache.find(LineInfo.FileName); if (FileBuffer != SourceCache.end()) { auto LineBuffer = LineCache.find(LineInfo.FileName); - if (LineBuffer != LineCache.end()) + if (LineBuffer != LineCache.end()) { + if (LineInfo.Line > LineBuffer->second.size()) + return; // Vector begins at 0, line numbers are non-zero OS << Delimiter << LineBuffer->second[LineInfo.Line - 1].ltrim() << "\n"; + } } } OldLineInfo = LineInfo;