Skip to content

Commit

Permalink
sparc: change imm type from int32_t to int64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Dec 27, 2017
1 parent 0601235 commit d19cedc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/python/capstone/sparc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SparcOpMem(ctypes.Structure):
class SparcOpValue(ctypes.Union):
_fields_ = (
('reg', ctypes.c_uint),
('imm', ctypes.c_int32),
('imm', ctypes.c_int64),
('mem', SparcOpMem),
)

Expand Down
2 changes: 1 addition & 1 deletion cstool/cstool_sparc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void print_insn_detail_sparc(csh handle, cs_insn *ins)
printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
break;
case SPARC_OP_IMM:
printf("\t\toperands[%u].type: IMM = 0x%x\n", i, op->imm);
printf("\t\toperands[%u].type: IMM = 0x%" PRIx64 "\n", i, op->imm);
break;
case SPARC_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i);
Expand Down
2 changes: 1 addition & 1 deletion include/capstone/sparc.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ typedef struct cs_sparc_op {
sparc_op_type type; // operand type
union {
sparc_reg reg; // register value for REG operand
int32_t imm; // immediate value for IMM operand
int64_t imm; // immediate value for IMM operand
sparc_op_mem mem; // base/disp value for MEM operand
};
} cs_sparc_op;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sparc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void print_insn_detail(cs_insn *ins)
printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
break;
case SPARC_OP_IMM:
printf("\t\toperands[%u].type: IMM = 0x%x\n", i, op->imm);
printf("\t\toperands[%u].type: IMM = 0x%" PRIx64 "\n", i, op->imm);
break;
case SPARC_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i);
Expand Down

0 comments on commit d19cedc

Please sign in to comment.