aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/IR/Module.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp
index f200da8..58115ef 100644
--- a/lib/IR/Module.cpp
+++ b/lib/IR/Module.cpp
@@ -262,7 +262,7 @@ Constant *Module::getOrInsertGlobal(StringRef Name, Type *Ty) {
// right type.
Type *GVTy = GV->getType();
PointerType *PTy = PointerType::get(Ty, GVTy->getPointerAddressSpace());
- if (GV->getType() != PTy)
+ if (GVTy != PTy)
return ConstantExpr::getBitCast(GV, PTy);
// Otherwise, we just found the existing function or a prototype.