From ec95f72490de0a7f86c35de3d00b50bb80d036a1 Mon Sep 17 00:00:00 2001 From: Vladimir Kostyukov Date: Wed, 23 Jul 2014 12:10:07 +0700 Subject: ART: Correct disassembling of 64bit immediates on x86_64 The patch fixes an issue with disassembling 'movsxd' and 'movabsq' instructions altered with 64bit immediates: not only a REX.W prefix may be prepended to these instructions. Change-Id: Ida7c7b368327a6b5cae1ff12ec00ceb0769c0a3d Signed-off-by: Vladimir Kostyukov --- disassembler/disassembler_x86.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'disassembler/disassembler_x86.cc') diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index 101a55d377..0ca8962282 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -268,7 +268,7 @@ DISASSEMBLER_ENTRY(cmp, target_specific = true; break; case 0x63: - if (rex == 0x48) { + if ((rex & REX_W) != 0) { opcode << "movsxd"; has_modrm = true; load = true; @@ -959,7 +959,7 @@ DISASSEMBLER_ENTRY(cmp, byte_operand = true; break; case 0xB8: case 0xB9: case 0xBA: case 0xBB: case 0xBC: case 0xBD: case 0xBE: case 0xBF: - if (rex == 0x48) { + if ((rex & REX_W) != 0) { opcode << "movabsq"; immediate_bytes = 8; reg_in_opcode = true; -- cgit v1.2.3-59-g8ed1b