diff options
author | Paul Robinson <paul.robinson@sony.com> | 2019-06-21 13:10:19 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2019-06-21 13:10:19 +0000 |
commit | 26cc5bcb1a392c9e352be35c50f18e1404d91159 (patch) | |
tree | d125a1c36a22fc1629f2e236052779bcd3917b68 /llvm/lib | |
parent | 36a999ffb8c245d516602d4e4725ef2c5c544184 (diff) | |
download | bcm5719-llvm-26cc5bcb1a392c9e352be35c50f18e1404d91159.tar.gz bcm5719-llvm-26cc5bcb1a392c9e352be35c50f18e1404d91159.zip |
Fix a crash with assembler source and -g.
llvm-mc or clang with -g normally produces debug info describing the
assembler source itself; however, if that source already contains some
.file/.loc directives, we should instead emit the debug info described
by those directives. For certain assembler sources seen in the wild
(particularly in the Chrome build) this was causing a crash due to
incorrect assumptions about legal sequences of assembler source text.
Fixes PR38994.
Differential Revision: https://reviews.llvm.org/D63573
llvm-svn: 364039
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index f0d78a43190..694845e74f5 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -3395,9 +3395,9 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) { } else { // In case there is a -g option as well as debug info from directive .file, // we turn off the -g option, directly use the existing debug info instead. - // Also reset any implicit ".file 0" for the assembler source. + // Throw away any implicit file table for the assembler source. if (Ctx.getGenDwarfForAssembly()) { - Ctx.getMCDwarfLineTable(0).resetRootFile(); + Ctx.getMCDwarfLineTable(0).resetFileTable(); Ctx.setGenDwarfForAssembly(false); } |