Skip to content

Commit 72b6582

Browse files
author
Dale Johannesen
committed
Use X86AddrNumOperands instead of magic constant one
more place. This fixes a bunch of x86-64 JIT regressions. (Introduced when the value of the magic constant changed in 68645. At the time apparently nobody noticed; failures were hidden in 70343-70439 by an unrelated bug, so showed up again as "new" failures in 70440.) llvm-svn: 71106
1 parent cfc0513 commit 72b6582

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/X86/X86CodeEmitter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ void Emitter::emitInstruction(const MachineInstr &MI,
709709
case X86II::MRM4m: case X86II::MRM5m:
710710
case X86II::MRM6m: case X86II::MRM7m: {
711711
intptr_t PCAdj = (CurOp + X86AddrNumOperands != NumOps) ?
712-
(MI.getOperand(CurOp+4).isImm() ? X86InstrInfo::sizeOfImm(Desc) : 4) : 0;
712+
(MI.getOperand(CurOp+X86AddrNumOperands).isImm() ?
713+
X86InstrInfo::sizeOfImm(Desc) : 4) : 0;
713714

714715
MCE.emitByte(BaseOpcode);
715716
emitMemModRMByte(MI, CurOp, (Desc->TSFlags & X86II::FormMask)-X86II::MRM0m,

0 commit comments

Comments
 (0)