arm: shift info associates with the right op in LDR instruction. bug reported by Daniel Colascione

v2
Nguyen Anh Quynh 11 years ago
parent a04ee4feb8
commit c70442edc6
  1. 12
      arch/ARM/ARMInstPrinter.c

@ -177,8 +177,12 @@ static void printRegImmShift(MCInst *MI, SStream *O, ARM_AM_ShiftOpc ShOpc,
//assert (!(ShOpc == ARM_AM_ror && !ShImm) && "Cannot have ror #0");
SStream_concat(O, ARM_AM_getShiftOpcStr(ShOpc));
if (MI->csh->detail)
if (MI->csh->detail) {
if (MI->csh->doing_mem)
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].shift.type = (arm_shifter)ShOpc;
else
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count - 1].shift.type = (arm_shifter)ShOpc;
}
if (ShOpc != ARM_AM_rrx) {
SStream_concat(O, " ");
@ -187,9 +191,13 @@ static void printRegImmShift(MCInst *MI, SStream *O, ARM_AM_ShiftOpc ShOpc,
SStream_concat(O, "#%u", translateShiftImm(ShImm));
if (_UseMarkup)
SStream_concat(O, ">");
if (MI->csh->detail)
if (MI->csh->detail) {
if (MI->csh->doing_mem)
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].shift.value = translateShiftImm(ShImm);
else
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count - 1].shift.value = translateShiftImm(ShImm);
}
}
}
static void printRegName(cs_struct *h, SStream *OS, unsigned RegNo)

Loading…
Cancel
Save