x86: address-size prefix should override RIP relative address in x64 mode. bug reported by @hlide

This commit is contained in:
Nguyen Anh Quynh 2014-06-30 07:57:29 +08:00
parent 656ebc9625
commit ed6b8c5a96
1 changed files with 10 additions and 6 deletions

View File

@ -411,9 +411,13 @@ static bool translateRMMemory(MCInst *mcInst, InternalInstruction *insn)
return true;
}
if (insn->mode == MODE_64BIT) {
if (insn->prefix3 == 0x67) // address-size prefix overrides RIP relative addressing
MCOperand_CreateReg0(mcInst, X86_EIP);
else
MCOperand_CreateReg0(mcInst, X86_RIP); // Section 2.2.1.6
} else
} else {
MCOperand_CreateReg0(mcInst, 0);
}
indexReg = 0;
break;