[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 13 15:27:02 PST 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.301 -> 1.302
---
Log message:

Do not overrun iterators.  This fixes a 176.gcc crash


---
Diffs of the changes:  (+1 -2)

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.301 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.302
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.301	Thu Jan 13 16:52:24 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Thu Jan 13 17:26:48 2005
@@ -2104,10 +2104,9 @@
   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)) {






More information about the llvm-commits mailing list