mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
AsmParser: Validate alloca's type
An alloca's type should be weird things like metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70fe9c6346
commit
5b71fffa58
@ -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) {
|
||||
|
9
test/Assembler/alloca-invalid-type.ll
Normal file
9
test/Assembler/alloca-invalid-type.ll
Normal 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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user