fix arm64_op_mem & arm64_op_type structures: int32_t is enough for imm & disp
diff --git a/include/arm64.h b/include/arm64.h
index 78f1b4b..c15a3fd 100644
--- a/include/arm64.h
+++ b/include/arm64.h
@@ -70,7 +70,7 @@
typedef struct arm64_op_mem {
unsigned int base; // base register
unsigned int index; // index register
- int64_t disp; // displacement/offset value
+ int32_t disp; // displacement/offset value
} arm64_op_mem;
// Instruction operand
@@ -83,7 +83,7 @@
arm64_op_type type; // operand type
union {
unsigned int reg; // register value for REG operand
- int64_t imm; // immediate value for C-IMM or IMM operand
+ int32_t imm; // immediate value, or index for C-IMM or IMM operand
double fp; // floating point value for FP operand
arm64_op_mem mem; // base/index/scale/disp value for MEM operand
};
diff --git a/tests/test_arm64.c b/tests/test_arm64.c
index 310d7c7..4801375 100644
--- a/tests/test_arm64.c
+++ b/tests/test_arm64.c
@@ -46,7 +46,7 @@
printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
break;
case ARM64_OP_IMM:
- printf("\t\toperands[%u].type: IMM = 0x%"PRIx64 "\n", i, op->imm);
+ printf("\t\toperands[%u].type: IMM = 0x%x\n", i, op->imm);
break;
case ARM64_OP_FP:
printf("\t\toperands[%u].type: FP = %f\n", i, op->fp);
@@ -58,11 +58,11 @@
if (op->mem.index != ARM64_REG_INVALID)
printf("\t\t\toperands[%u].mem.index: REG = %s\n", i, cs_reg_name(handle, op->mem.index));
if (op->mem.disp != 0)
- printf("\t\t\toperands[%u].mem.disp: 0x%" PRIx64 "\n", i, op->mem.disp);
+ printf("\t\t\toperands[%u].mem.disp: 0x%x\n", i, op->mem.disp);
break;
case ARM64_OP_CIMM:
- printf("\t\toperands[%u].type: C-IMM = %"PRIu64 "\n", i, op->imm);
+ printf("\t\toperands[%u].type: C-IMM = %u\n", i, op->imm);
break;
}