Print properly signed displacement in IA32 disassembler.

R=jkummerow@chromium.org
BUG=

Review URL: https://codereview.chromium.org/176993004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19652 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 45ebabfb
......@@ -449,8 +449,12 @@ int DisassemblerIA32::PrintRightOperandHelper(
} else {
// No sib.
int disp =
mod == 2 ? *reinterpret_cast<int32_t*>(modrmp + 1) : *(modrmp + 1);
AppendToBuffer("[%s+0x%x]", (this->*register_name)(rm), disp);
mod == 2 ? *reinterpret_cast<int32_t*>(modrmp + 1) :
*reinterpret_cast<int8_t*>(modrmp + 1);
AppendToBuffer("[%s%s0x%x]",
(this->*register_name)(rm),
disp < 0 ? "-" : "+",
disp < 0 ? -disp : disp);
return mod == 2 ? 5 : 2;
}
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