incorrect type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15519
91177308-0d34-0410-b5e6-
96231b3b80d8
const std::string &Name, Module *ParentModule)
: GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, Link, Name),
isConstantGlobal(constant) {
const std::string &Name, Module *ParentModule)
: GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, Link, Name),
isConstantGlobal(constant) {
- if (Initializer) Operands.push_back(Use((Value*)Initializer, this));
+ if (Initializer) {
+ assert(Initializer->getType() == Ty &&
+ "Initializer should be the same type as the GlobalVariable!");
+ Operands.push_back(Use((Value*)Initializer, this));
+ }
LeakDetector::addGarbageObject(this);
LeakDetector::addGarbageObject(this);