sparc: change imm type from int32_t to int64_t

This commit is contained in:
Nguyen Anh Quynh 2017-12-27 14:46:47 +08:00
parent 06012353a9
commit d19cedc514
4 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class SparcOpMem(ctypes.Structure):
class SparcOpValue(ctypes.Union): class SparcOpValue(ctypes.Union):
_fields_ = ( _fields_ = (
('reg', ctypes.c_uint), ('reg', ctypes.c_uint),
('imm', ctypes.c_int32), ('imm', ctypes.c_int64),
('mem', SparcOpMem), ('mem', SparcOpMem),
) )

View File

@ -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)); printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
break; break;
case SPARC_OP_IMM: 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; break;
case SPARC_OP_MEM: case SPARC_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i); printf("\t\toperands[%u].type: MEM\n", i);

View File

@ -190,7 +190,7 @@ typedef struct cs_sparc_op {
sparc_op_type type; // operand type sparc_op_type type; // operand type
union { union {
sparc_reg reg; // register value for REG operand 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 sparc_op_mem mem; // base/disp value for MEM operand
}; };
} cs_sparc_op; } cs_sparc_op;

View File

@ -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)); printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
break; break;
case SPARC_OP_IMM: 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; break;
case SPARC_OP_MEM: case SPARC_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i); printf("\t\toperands[%u].type: MEM\n", i);