mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-01 23:25:56 +00:00
Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7cb77e188f
commit
e0c60038eb
@ -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()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user