diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 7eff9cc7e36..fe8e9c7f07d 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -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;