From 5f6eaac6115a44f4ef3d819123f8694d3d5825ea Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Sat, 16 Jan 2016 20:30:46 +0000 Subject: GlobalValue: use getValueType() instead of getType()->getPointerElementType(). Reviewers: mjacob Subscribers: jholewinski, arsenm, dsanders, dblaikie Patch by Eduard Burtescu. Differential Revision: http://reviews.llvm.org/D16260 llvm-svn: 257999 --- llvm/lib/IR/Globals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/Globals.cpp') diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index a61b62bd968..2b8a4cf029a 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -242,7 +242,7 @@ void GlobalVariable::setInitializer(Constant *InitVal) { setGlobalVariableNumOperands(0); } } else { - assert(InitVal->getType() == getType()->getElementType() && + assert(InitVal->getType() == getValueType() && "Initializer type must match GlobalVariable type"); // Note, the num operands is used to compute the offset of the operand, so // the order here matters. We need to set num operands to 1 first so that -- cgit v1.2.3