mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-29 14:40:25 +00:00
don't load element before checking to see if it is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
145ab10711
commit
bda20650d2
@ -2172,9 +2172,9 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C,
|
||||
bool inBounds,
|
||||
IndexTy const *Idxs,
|
||||
unsigned NumIdx) {
|
||||
if (NumIdx == 0) return C;
|
||||
Constant *Idx0 = cast<Constant>(Idxs[0]);
|
||||
if (NumIdx == 0 ||
|
||||
(NumIdx == 1 && Idx0->isNullValue()))
|
||||
if ((NumIdx == 1 && Idx0->isNullValue()))
|
||||
return C;
|
||||
|
||||
if (isa<UndefValue>(C)) {
|
||||
|
Loading…
Reference in New Issue
Block a user