mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
don't load element before checking to see if it is valid.
llvm-svn: 134836
This commit is contained in:
parent
60e47d6d24
commit
4f458101b7
@ -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