turn an assert into a proper check, fixing crash on invalid here:

$ llvm-as t.ll
llvm-as: t.ll:1:6: error: expected 'type' after '='
%0 = = type { i32, float, float, double }
     ^

PR6810.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-04-10 18:01:25 +00:00
parent 47e476609b
commit f7240de877

View File

@ -322,9 +322,8 @@ bool LLParser::ParseUnnamedType() {
return true;
}
assert(Lex.getKind() == lltok::kw_type);
LocTy TypeLoc = Lex.getLoc();
Lex.Lex(); // eat kw_type
if (ParseToken(lltok::kw_type, "expected 'type' after '='")) return true;
PATypeHolder Ty(Type::getVoidTy(Context));
if (ParseType(Ty)) return true;