Skip to content

Commit

Permalink
arm: add lshift field to arm_op_mem to provide left-shift value for i…
Browse files Browse the repository at this point in the history
…ndex register in some memory op. issue reported by @jabba2989
  • Loading branch information
aquynh committed Jan 12, 2015
1 parent 499f0ca commit 706b808
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/ARM/ARMInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,7 @@ static void printAddrModeTBH(MCInst *MI, unsigned Op, SStream *O)
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.index = MCOperand_getReg(MO2);
SStream_concat0(O, ", lsl #1]");
if (MI->csh->detail) {
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].shift.type = ARM_SFT_LSL;
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].shift.value = 1;
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.lshift = 1;
}
set_mem_access(MI, false);
}
Expand Down Expand Up @@ -1986,8 +1985,7 @@ static void printT2AddrModeSoRegOperand(MCInst *MI,
SStream_concat0(O, ", lsl ");
SStream_concat(O, "#%d", ShAmt);
if (MI->csh->detail) {
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count - 1].shift.type = ARM_SFT_LSL;
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count - 1].shift.value = ShAmt;
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.lshift = ShAmt;
}
}

Expand Down
1 change: 1 addition & 0 deletions include/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ typedef struct arm_op_mem {
unsigned int index; // index register
int scale; // scale for index register (can be 1, or -1)
int disp; // displacement/offset value
int lshift; // left-shift on index register, or 0 if irrelevant.
} arm_op_mem;

// Instruction operand
Expand Down

0 comments on commit 706b808

Please sign in to comment.