Commit 1ea17318 authored by Kanghua Yu's avatar Kanghua Yu Committed by Commit Bot

[x64] Bugfix for immediate decoding of IA instruction

-- original --
143  0fb7400b       movzxwl rax,[rax+0xb]
147  663d8200745a   cmp rax,0x5a740082
14d  663d83007437   cmp rax,0x37740083

-- patched --
143  0fb7400b       movzxwl rax,[rax+0xb]
147  663d8200       cmp rax,0x82
14b  745a           jz 0x3f54d39c767  <+0x1a7>
14d  663d8300       cmp rax,0x83
151  7437           jz 0x3f54d39c74a  <+0x18a>

Bug: 
Change-Id: I86f2147d983da9c33ea59a6d8a0a634dcaf32108
Reviewed-on: https://chromium-review.googlesource.com/833508
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50540}
parent b785d2a2
......@@ -2387,10 +2387,15 @@ int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
}
case SHORT_IMMEDIATE_INSTR: {
byte* addr =
reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
AppendToBuffer("%s rax,%s", idesc.mnem, NameOfAddress(addr));
data += 5;
int32_t imm;
if (operand_size() == OPERAND_WORD_SIZE) {
imm = *reinterpret_cast<int16_t*>(data + 1);
data += 3;
} else {
imm = *reinterpret_cast<int32_t*>(data + 1);
data += 5;
}
AppendToBuffer("%s rax,0x%x", idesc.mnem, imm);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment