mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-14 15:33:34 +00:00
Be a bit more aggressive in bailing out of this routine. Spotted by
inspection by Duncan during review. My suspicion is that we would still have returned 0 anyways in this case, but doing it sooner is better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8ed1ed8dfd
commit
ad41dcfd87
@ -1336,7 +1336,7 @@ static Value *getNaturalGEPRecursively(IRBuilder<> &IRB, const TargetData &TD,
|
||||
|
||||
const StructLayout *SL = TD.getStructLayout(STy);
|
||||
uint64_t StructOffset = Offset.getZExtValue();
|
||||
if (StructOffset > SL->getSizeInBytes())
|
||||
if (StructOffset >= SL->getSizeInBytes())
|
||||
return 0;
|
||||
unsigned Index = SL->getElementContainingOffset(StructOffset);
|
||||
Offset -= APInt(Offset.getBitWidth(), SL->getElementOffset(Index));
|
||||
|
Loading…
x
Reference in New Issue
Block a user