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 | 9576acc6cea45ccc0e51a036ec27fc7b35edb5f3 (patch) | |
| tree | 3bfe737ab919ea5f39342848dad3c3c6bb870927 /lib | |
| parent | ac254d09bb9b4451c0daa12a768046084b31f3cc (diff) | |
| download | external_llvm-9576acc6cea45ccc0e51a036ec27fc7b35edb5f3.zip external_llvm-9576acc6cea45ccc0e51a036ec27fc7b35edb5f3.tar.gz external_llvm-9576acc6cea45ccc0e51a036ec27fc7b35edb5f3.tar.bz2 | |
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')
| -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 7eff9cc..fe8e9c7 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; |
