[llvm-commits] CVS: llvm/lib/VMCore/ConstantHandling.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue May 13 21:48:01 PDT 2003
Changes in directory llvm/lib/VMCore:
ConstantHandling.cpp updated: 1.28 -> 1.29
---
Log message:
Fix bug
---
Diffs of the changes:
Index: llvm/lib/VMCore/ConstantHandling.cpp
diff -u llvm/lib/VMCore/ConstantHandling.cpp:1.28 llvm/lib/VMCore/ConstantHandling.cpp:1.29
--- llvm/lib/VMCore/ConstantHandling.cpp:1.28 Tue May 13 16:50:52 2003
+++ llvm/lib/VMCore/ConstantHandling.cpp Tue May 13 21:47:13 2003
@@ -157,7 +157,8 @@
// To: int* getelementptr ([3 x int]* %X, long 0, long 0)
//
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
- if (CE->getOpcode() == Instruction::Cast && IdxList.size() > 1)
+ if (CE->getOpcode() == Instruction::Cast && IdxList.size() > 1 &&
+ IdxList[0]->isNullValue())
if (const PointerType *SPT =
dyn_cast<PointerType>(CE->getOperand(0)->getType()))
if (const ArrayType *SAT = dyn_cast<ArrayType>(SPT->getElementType()))
More information about the llvm-commits
mailing list