aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/iMemory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/iMemory.cpp b/lib/VMCore/iMemory.cpp
index 32fe71a086..da4cc7483f 100644
--- a/lib/VMCore/iMemory.cpp
+++ b/lib/VMCore/iMemory.cpp
@@ -161,8 +161,8 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
// of being refined to another type (and hence, may have dropped all
// references to what it was using before). So, use the new forwarded
// type.
- if (Ptr->getForwardedType()) {
- Ptr = Ptr->getForwardedType();
+ if (const Type * Ty = Ptr->getForwardedType()) {
+ Ptr = Ty;
}
}
return CurIdx == Idx.size() ? Ptr : 0;