]> granicus.if.org Git - llvm/commit
Fix a crash with assembler source and -g.
authorPaul Robinson <paul.robinson@sony.com>
Fri, 21 Jun 2019 13:10:19 +0000 (13:10 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 21 Jun 2019 13:10:19 +0000 (13:10 +0000)
commitfcfd4087ad5bd48d7add23a8759dd281cdff33cc
treee8dc5ac483c043173580b93488c524a6fb2787eb
parent711743a836ed56bf08b586b8cde6f3859e72394a
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364039 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCDwarf.h
lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/directive_file-g.s [new file with mode: 0644]