1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

AsmParser: Don't crash on malformed attribute groups

This fixes PR21785.

llvm-svn: 223801
This commit is contained in:
David Majnemer 2014-12-09 18:33:57 +00:00
parent 2b8dd30859
commit 9047561af5
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,4 @@
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
attributes
; CHECK: expected attribute group id