From d19cedc51433370bd239e40fb1d227f399f6fc3d Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Wed, 27 Dec 2017 14:46:47 +0800 Subject: [PATCH] sparc: change imm type from int32_t to int64_t --- bindings/python/capstone/sparc.py | 2 +- cstool/cstool_sparc.c | 2 +- include/capstone/sparc.h | 2 +- tests/test_sparc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/capstone/sparc.py b/bindings/python/capstone/sparc.py index f181af8c..1c536ff0 100644 --- a/bindings/python/capstone/sparc.py +++ b/bindings/python/capstone/sparc.py @@ -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), ) diff --git a/cstool/cstool_sparc.c b/cstool/cstool_sparc.c index 49f82940..4d914be7 100644 --- a/cstool/cstool_sparc.c +++ b/cstool/cstool_sparc.c @@ -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); diff --git a/include/capstone/sparc.h b/include/capstone/sparc.h index 21543145..4a283983 100644 --- a/include/capstone/sparc.h +++ b/include/capstone/sparc.h @@ -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; diff --git a/tests/test_sparc.c b/tests/test_sparc.c index 8444b1f5..122829a5 100644 --- a/tests/test_sparc.c +++ b/tests/test_sparc.c @@ -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);