summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-09 18:33:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-09 18:33:57 +0000
commitb39e22bdc504ba77e2cd385538b6634808cda66e (patch)
tree9269468c5537e652160284755826e845fb8a87e1 /llvm/lib
parent30dcb232b0b34efc845e4888024d32b79094486c (diff)
downloadbcm5719-llvm-b39e22bdc504ba77e2cd385538b6634808cda66e.tar.gz
bcm5719-llvm-b39e22bdc504ba77e2cd385538b6634808cda66e.zip
AsmParser: Don't crash on malformed attribute groups
This fixes PR21785. llvm-svn: 223801
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index b0edeb40d05..a682f97ceb2 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -869,7 +869,9 @@ bool LLParser::ParseUnnamedAttrGrp() {
LocTy AttrGrpLoc = Lex.getLoc();
Lex.Lex();
- assert(Lex.getKind() == lltok::AttrGrpID);
+ if (Lex.getKind() != lltok::AttrGrpID)
+ return TokError("expected attribute group id");
+
unsigned VarID = Lex.getUIntVal();
std::vector<unsigned> unused;
LocTy BuiltinLoc;
OpenPOWER on IntegriCloud