aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index b8ff3d4e7e..e8f52d1157 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2104,10 +2104,9 @@ static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) {
uint64_t PtrSizeMask = ~0ULL;
PtrSizeMask >>= 64-(TD.getPointerSize()*8);
- ++GTI; // Measure type stepping over.
for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
Value *Op = GEP->getOperand(i);
- uint64_t Size = TD.getTypeSize(*GTI) & PtrSizeMask;
+ uint64_t Size = TD.getTypeSize(GTI.getIndexedType()) & PtrSizeMask;
Constant *Scale = ConstantExpr::getCast(ConstantUInt::get(UIntPtrTy, Size),
SIntPtrTy);
if (Constant *OpC = dyn_cast<Constant>(Op)) {