mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
AsmParser: Make sure GlobalVariables have sane types
llvm-svn: 229364
This commit is contained in:
parent
b5464fbff9
commit
7f40c08dca
@ -749,7 +749,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Ty->isFunctionTy() || Ty->isLabelTy())
|
||||
if (Ty->isFunctionTy() || !PointerType::isValidElementType(Ty))
|
||||
return Error(TyLoc, "invalid type for global variable");
|
||||
|
||||
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…
x
Reference in New Issue
Block a user