mirror of
https://gitlab.com/qemu-project/capstone.git
synced 2025-07-03 04:42:13 +08:00
Fix ARM operand subtracted field (#1163)
This commit is contained in:

committed by
Nguyen Anh Quynh

parent
8f7c495e05
commit
62f1d9fe14
@ -1157,7 +1157,7 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO2));
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.index = MCOperand_getReg(MO2);
|
||||
if (!sign) {
|
||||
if (sign == ARM_AM_sub) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.scale = -1;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = true;
|
||||
}
|
||||
@ -1178,7 +1178,7 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
|
||||
}
|
||||
|
||||
if (MI->csh->detail) {
|
||||
if (!sign) {
|
||||
if (sign == ARM_AM_sub) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = -(int)ImmOffs;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = true;
|
||||
} else
|
||||
@ -1228,13 +1228,8 @@ static void printAddrMode3OffsetOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
SStream_concat(O, "#%s%u", ARM_AM_getAddrOpcStr(subtracted), ImmOffs);
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_IMM;
|
||||
|
||||
if (subtracted) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = ImmOffs;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = true;
|
||||
} else
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = -(int)ImmOffs;
|
||||
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = ImmOffs;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = subtracted == ARM_AM_sub;
|
||||
MI->flat_insn->detail->arm.op_count++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user