summaryrefslogtreecommitdiff
path: root/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
commit1c9cd021c8999d9c2c0786dff074d1e75bbd0eb2 (patch)
treef1b079448b190a896c4e474d663a9950cdb63b32 /lib/MC/MCParser
parent623f2025a7a32de68a5ab402aa2b50ca3e3a6958 (diff)
downloadllvm-1c9cd021c8999d9c2c0786dff074d1e75bbd0eb2.tar.gz
llvm-1c9cd021c8999d9c2c0786dff074d1e75bbd0eb2.tar.bz2
llvm-1c9cd021c8999d9c2c0786dff074d1e75bbd0eb2.tar.xz
[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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index dd0d181b6f..07796dd6b0 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/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;