MC: Don't crash after issuing a diagnostic.
authorJim Grosbach <grosbach@apple.com>
Fri, 16 Oct 2015 22:07:59 +0000 (22:07 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 16 Oct 2015 22:07:59 +0000 (22:07 +0000)
commit81e84a5e39617d51285e029f61c7b85011774858
treea6998bcee7cb79c6e36507da4dfd2da3133fffc0
parentddcfde9768d8277f51395dee7201395888d239ba
MC: Don't crash after issuing a diagnostic.

Crashing is bad, m'kay? Fixing a 4 year old bug of my own creation.
Adding the testcase now which I should have added then which would have
long since caught this.

The problem is that printMessage() will display the diagnostic but not
set HadError to true, resulting in the assembler continuing on its way
and trying to create relocations for things that may not allow them or
otherwise get itself into trouble. Using the Error() helper function
here rather than calling printMessage() directly resolves this.

rdar://23133240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250557 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/undefined-local-symbol.s [new file with mode: 0644]