forked from OSchip/llvm-project
AsmParser: Don't crash on malformed attribute groups
This fixes PR21785. llvm-svn: 223801
This commit is contained in:
parent
30dcb232b0
commit
b39e22bdc5
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
||||
|
||||
attributes
|
||||
; CHECK: expected attribute group id
|
Loading…
Reference in New Issue