diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-10 18:01:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-10 18:01:25 +0000 |
commit | f7240de877e790d9e377c1fe49b6d7a14c1a9674 (patch) | |
tree | 3bfe737ab919ea5f39342848dad3c3c6bb870927 /lib/AsmParser/LLParser.cpp | |
parent | 47e476609bd3a0d2fe6291ac4a860b9306d97442 (diff) |
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
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 7eff9cc7e3..fe8e9c7f07 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; |