X86 address displacement field must be interpreted as a 32-bit value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-09-26 16:58:16 +00:00
parent e52cb70767
commit 4367ff7aff

View File

@ -427,9 +427,10 @@ void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
// FrameIndex with base register with EBP. Add an offset to the offset.
MI.getOperand(i).ChangeToRegister(BasePtr, false);
// Now add the frame object offset to the offset from EBP.
int64_t Offset = getFrameIndexOffset(MF, FrameIndex) +
MI.getOperand(i+3).getImm();
// Now add the frame object offset to the offset from EBP. Offset is a
// 32-bit integer.
int Offset = getFrameIndexOffset(MF, FrameIndex) +
(int)(MI.getOperand(i+3).getImm());
MI.getOperand(i+3).ChangeToImmediate(Offset);
}