arm64: print immediate as signed int64 for memory operands. suggested by @pancake

test2
Nguyen Anh Quynh 10 years ago
parent f0677abb8f
commit b6f0d440b2
  1. 13
      arch/AArch64/AArch64InstPrinter.c

@ -47,11 +47,11 @@ static void printShifter(MCInst *MI, unsigned OpNum, SStream *O);
static void set_mem_access(MCInst *MI, bool status)
{
MI->csh->doing_mem = status;
if (MI->csh->detail != CS_OPT_ON)
return;
MI->csh->doing_mem = status;
if (status) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_MEM;
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].mem.base = ARM64_REG_INVALID;
@ -611,8 +611,13 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
if (MI->Opcode == AArch64_ADR) {
imm += MI->address;
printUInt64Bang(O, imm);
} else
printUInt64Bang(O, imm);
} else {
if (MI->csh->doing_mem)
printInt64Bang(O, imm);
else
printUInt64Bang(O, imm);
}
if (MI->csh->detail) {
if (MI->csh->doing_mem) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].mem.disp = (int32_t)imm;

Loading…
Cancel
Save