Skip to content

Commit 0cd442f

Browse files
committed
Fix off by error for mem operands.
1 parent e60d04b commit 0cd442f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/ARM/ARMMapping.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ static void add_cs_detail_general(MCInst *MI, arm_op_group op_group, unsigned Op
824824
ARM_set_detail_op_mem(MI, OpNum, false, 0, 0, ARM_get_op_val(MI, OpNum));
825825
int64_t Imm = ARM_get_op_val(MI, OpNum + 1);
826826
if (Imm)
827-
ARM_set_detail_op_mem(MI, OpNum + 1, false, 0, 0, ARM_get_op_val(MI, OpNum));
827+
ARM_set_detail_op_mem(MI, OpNum + 1, false, 0, 0, Imm * 4);
828828
set_mem_access(MI, false);
829829
break;
830830
case ARM_OP_GROUP_PKHLSLShiftImm: {
@@ -960,7 +960,7 @@ static void add_cs_detail_template_1(MCInst *MI, arm_op_group op_group, unsigned
960960
int32_t Imm = ARM_get_op_val(MI, OpNum + 1);
961961
if (Imm == INT32_MIN)
962962
Imm = 0;
963-
ARM_set_detail_op_mem(MI, OpNum, false, 0, 0, Imm);
963+
ARM_set_detail_op_mem(MI, OpNum + 1, false, 0, 0, Imm);
964964
set_mem_access(MI, false);
965965
break;
966966
}
@@ -987,7 +987,7 @@ static void add_cs_detail_template_1(MCInst *MI, arm_op_group op_group, unsigned
987987
set_mem_access(MI, false);
988988
break;
989989
}
990-
ARM_set_detail_op_mem(MI, OpNum, true, 0, 0, ARM_get_op_val(MI, OpNum + 1));
990+
ARM_set_detail_op_mem(MI, OpNum + 1, true, 0, 0, ARM_get_op_val(MI, OpNum + 1));
991991
ARM_AM_AddrOpc Sign = ARM_AM_getAM3Op(ARM_get_op_val(MI, OpNum + 2));
992992
if (Sign == ARM_AM_sub) {
993993
ARM_get_detail_op(MI, 0)->mem.scale = -1;
@@ -1035,11 +1035,12 @@ static void add_cs_detail_template_1(MCInst *MI, arm_op_group op_group, unsigned
10351035
unsigned Shift = temp_arg_0;
10361036
set_mem_access(MI, true);
10371037
ARM_set_detail_op_mem(MI, OpNum, false, 0, 0, ARM_get_op_val(MI, OpNum));
1038-
ARM_set_detail_op_mem(MI, OpNum, true, 0, 0, ARM_get_op_val(MI, OpNum));
1038+
ARM_set_detail_op_mem(MI, OpNum + 1, true, 0, 0, ARM_get_op_val(MI, OpNum + 1));
10391039
if (Shift > 0) {
10401040
add_cs_detail_RegImmShift(MI, ARM_AM_uxtw, Shift);
10411041
}
10421042
set_mem_access(MI, false);
1043+
break;
10431044
}
10441045
case ARM_OP_GROUP_MVEVectorList_2:
10451046
case ARM_OP_GROUP_MVEVectorList_4: {

0 commit comments

Comments
 (0)