AsmParser: Don't crash on an ill-formed MDNodeVector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2014-12-11 20:51:54 +00:00
parent f27500040b
commit 054eb6cba6
2 changed files with 6 additions and 2 deletions

View File

@ -2968,8 +2968,8 @@ bool LLParser::ParseMetadataAsValue(ValID &ID, PerFunctionState *PFS) {
/// ::= !{...}
/// ::= !"string"
bool LLParser::ParseMetadata(Metadata *&MD, PerFunctionState *PFS) {
assert(Lex.getKind() == lltok::exclaim);
Lex.Lex();
if (ParseToken(lltok::exclaim, "expected '!' here"))
return true;
// MDNode:
// !{ ... }

View File

@ -0,0 +1,4 @@
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
!0 = metadata !{metadata
; CHECK: expected '!' here