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

llvm-svn: 224056
This commit is contained in:
David Majnemer 2014-12-11 20:51:54 +00:00
parent 54cc3c2f23
commit 0a14c0ec9d
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