projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cb77e1
)
Fix bug
author
Chris Lattner
<sabre@nondot.org>
Wed, 14 May 2003 02:47:13 +0000
(
02:47
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 14 May 2003 02:47:13 +0000
(
02:47
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6184
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/ConstantFold.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/ConstantFold.cpp
b/lib/VMCore/ConstantFold.cpp
index ee5611ea7deb8ba7762e2dfd1bdfd7fba0ebcc6f..db8cc4487c166b2b3718e22cdf1d51574eb366c3 100644
(file)
--- a/
lib/VMCore/ConstantFold.cpp
+++ b/
lib/VMCore/ConstantFold.cpp
@@
-157,7
+157,8
@@
Constant *ConstantFoldGetElementPtr(const Constant *C,
// 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()))