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

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 2 19:30:01 PST 2003


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.134 -> 1.135

---
Log message:

Fix bug with zero sized casts


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

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.134 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.135
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.134	Sun Nov  2 00:54:48 2003
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sun Nov  2 19:29:41 2003
@@ -1552,7 +1552,7 @@
         unsigned CastElTySize = TD->getTypeSize(CastElTy);
         
         // If the allocation is for an even multiple of the cast type size
-        if (AllocElTySize % CastElTySize == 0) {
+        if (CastElTySize && (AllocElTySize % CastElTySize == 0)) {
           Value *Amt = ConstantUInt::get(Type::UIntTy, 
                                          AllocElTySize/CastElTySize);
           std::string Name = AI->getName(); AI->setName("");





More information about the llvm-commits mailing list