AsmParser: Validate alloca's type
An alloca's type should be weird things like metadata. llvm-svn: 228820
This commit is contained in:
parent
04578fcfa5
commit
fad5a31160
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue