AsmParser: Validate alloca's type

An alloca's type should be weird things like metadata.

llvm-svn: 228820
This commit is contained in:
David Majnemer 2015-02-11 09:13:11 +00:00
parent 04578fcfa5
commit fad5a31160
2 changed files with 12 additions and 0 deletions

View File

@ -4633,6 +4633,9 @@ int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
if (ParseType(Ty)) return true;
if (!PointerType::isValidElementType(Ty))
return TokError("pointer to this type is invalid");
bool AteExtraComma = false;
if (EatIfPresent(lltok::comma)) {
if (Lex.getKind() == lltok::kw_align) {

View File

@ -0,0 +1,9 @@
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: pointer to this type is invalid
define void @test() {
entry:
alloca metadata !{null}
ret void
}