mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +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:
@@ -2172,9 +2172,9 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C,
|
|||||||
bool inBounds,
|
bool inBounds,
|
||||||
IndexTy const *Idxs,
|
IndexTy const *Idxs,
|
||||||
unsigned NumIdx) {
|
unsigned NumIdx) {
|
||||||
|
if (NumIdx == 0) return C;
|
||||||
Constant *Idx0 = cast<Constant>(Idxs[0]);
|
Constant *Idx0 = cast<Constant>(Idxs[0]);
|
||||||
if (NumIdx == 0 ||
|
if ((NumIdx == 1 && Idx0->isNullValue()))
|
||||||
(NumIdx == 1 && Idx0->isNullValue()))
|
|
||||||
return C;
|
return C;
|
||||||
|
|
||||||
if (isa<UndefValue>(C)) {
|
if (isa<UndefValue>(C)) {
|
||||||
|
Reference in New Issue
Block a user