1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

fix off by 1 error in displacement computation

llvm-svn: 35602
This commit is contained in:
Dale Johannesen 2007-04-02 20:31:06 +00:00
parent 726d461daf
commit e1c3dc7c78

View File

@ -593,6 +593,11 @@ bool ARMConstantIslands::WaterIsInRange(unsigned UserOffset,
Water->begin()->getOpcode() != ARM::CONSTPOOL_ENTRY))
CPEOffset += 2;
// If the CPE is to be inserted before the instruction, that will raise
// the offset of the instruction.
if (CPEOffset < UserOffset)
UserOffset += isThumb ? 2 : 4;
return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb);
}