summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2013-08-09 01:52:03 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2013-08-09 01:52:03 +0000
commit4208b618587fddf163540b18f8b4893d1cd1ae26 (patch)
tree5c2e55b522aa1a2b33e9a7fe5395a2933be0c290 /llvm/lib/MC/MCParser
parentd7414e25dafda519bf2ab8932b5d43a1a4762dc5 (diff)
downloadbcm5719-llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.tar.gz
bcm5719-llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.zip
[CodeGen] prevent abnormal on invalid attributes
Currently, when an invalid attribute is encountered on processing a .s file, clang will abort due to llvm_unreachable. Invalid user input should not cause an abnormal termination of the compiler. Change the interface to return a boolean to indicate the failure as a first step towards improving hanlding of malformed user input to clang. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 188047
Diffstat (limited to 'llvm/lib/MC/MCParser')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index dd0d181b6f3..07796dd6b08 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -3375,7 +3375,8 @@ bool AsmParser::ParseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
if (Sym->isTemporary())
return Error(Loc, "non-local symbol required in directive");
- getStreamer().EmitSymbolAttribute(Sym, Attr);
+ if (!getStreamer().EmitSymbolAttribute(Sym, Attr))
+ return Error(Loc, "unable to emit symbol attribute");
if (getLexer().is(AsmToken::EndOfStatement))
break;
OpenPOWER on IntegriCloud