fix off by 1 error in displacement computation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen 2007-04-02 20:31:06 +00:00
parent 6e0784da77
commit d959aa421a

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);
}