mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
AsmParser: Make sure GlobalVariables have sane types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b3dd3c7ac3
commit
40d10639cf
@ -749,7 +749,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ty->isFunctionTy() || Ty->isLabelTy())
|
if (Ty->isFunctionTy() || !PointerType::isValidElementType(Ty))
|
||||||
return Error(TyLoc, "invalid type for global variable");
|
return Error(TyLoc, "invalid type for global variable");
|
||||||
|
|
||||||
GlobalValue *GVal = nullptr;
|
GlobalValue *GVal = nullptr;
|
||||||
|
4
test/Assembler/gv-invalid-type.ll
Normal file
4
test/Assembler/gv-invalid-type.ll
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
@gv = global metadata undef
|
||||||
|
; CHECK: invalid type for global variable
|
Loading…
Reference in New Issue
Block a user