summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-10 18:01:25 +0000
committerChris Lattner <sabre@nondot.org>2010-04-10 18:01:25 +0000
commitf60b74806f9989a6de59401a0e27980832e5b41b (patch)
tree72c59c088017de44845fb1ffc7826bb52798015d /llvm/lib
parent3a747aef961673ac6ef9c1b00f8a8e9ca54b8220 (diff)
downloadbcm5719-llvm-f60b74806f9989a6de59401a0e27980832e5b41b.tar.gz
bcm5719-llvm-f60b74806f9989a6de59401a0e27980832e5b41b.zip
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. llvm-svn: 100934
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 7eff9cc7e36..fe8e9c7f07d 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud