1
0
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:
David Majnemer 2015-02-16 08:41:08 +00:00
parent b5464fbff9
commit 7f40c08dca
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,4 @@
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
@gv = global metadata undef
; CHECK: invalid type for global variable