forked from OSchip/llvm-project
fix off by 1 error in displacement computation
llvm-svn: 35602
This commit is contained in:
parent
8e168a4f36
commit
d13786dd82
|
@ -593,6 +593,11 @@ bool ARMConstantIslands::WaterIsInRange(unsigned UserOffset,
|
||||||
Water->begin()->getOpcode() != ARM::CONSTPOOL_ENTRY))
|
Water->begin()->getOpcode() != ARM::CONSTPOOL_ENTRY))
|
||||||
CPEOffset += 2;
|
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);
|
return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue