From 2986c20a1334dcea7cb4c5fe1e56633e2186abfc Mon Sep 17 00:00:00 2001 From: R33v0LT Date: Mon, 4 Mar 2024 19:43:18 +0300 Subject: [PATCH] Fix invalid break instruction decode Remove unused code --- arch/HPPA/HPPADisassembler.c | 4 +--- arch/HPPA/HPPAInstPrinter.c | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/HPPA/HPPADisassembler.c b/arch/HPPA/HPPADisassembler.c index 677b2cd60f..031c7156d8 100644 --- a/arch/HPPA/HPPADisassembler.c +++ b/arch/HPPA/HPPADisassembler.c @@ -395,6 +395,7 @@ static bool decodeSysop(cs_struct *ud, MCInst *MI, uint32_t insn) { case 0x00: MCOperand_CreateImm0(MI, t); MCOperand_CreateImm0(MI, GET_FIELD(insn, 6, 18)); + return true; case 0x20: if (ext5 != 0x00 && ext5 != 0x10) { return false; @@ -1685,7 +1686,6 @@ static bool decodeShexdep0(cs_struct *ud, MCInst *MI, uint32_t insn) { uint32_t cp = GET_BIT(insn, 20); uint32_t cpos = GET_FIELD(insn, 22, 26); uint32_t sa = 63 - ((cp << 5) | cpos); - // uint32_t d = GET_BIT(insn, 22); uint32_t r1 = GET_FIELD(insn, 11, 15); uint32_t r2 = GET_FIELD(insn, 6, 10); uint32_t clen_t = GET_FIELD(insn, 27, 31); @@ -2738,7 +2738,6 @@ static bool decodeCopr(cs_struct *ud, MCInst *MI, uint32_t insn) { } else if (class == 2) { uint32_t n = GET_BIT(insn, 26); - // uint32_t cond = GET_FIELD(insn, 27, 31); subop = GET_FIELD(insn, 16, 18); if (n == 0) { CREATE_FPR_REG(MI, r1); @@ -3561,7 +3560,6 @@ static bool getInstruction(cs_struct *ud, const uint8_t *code, size_t code_len, memset(HPPA_EXT_REF(MI), 0, sizeof(MI->hppa_ext)); uint32_t full_insn = readBytes32(MI, code); - // printf("full_insn: %x\n", full_insn); uint8_t opcode = full_insn >> 26; if (MODE_IS_HPPA_20(ud->mode)) { diff --git a/arch/HPPA/HPPAInstPrinter.c b/arch/HPPA/HPPAInstPrinter.c index a4bb900ba4..db089cd8f8 100644 --- a/arch/HPPA/HPPAInstPrinter.c +++ b/arch/HPPA/HPPAInstPrinter.c @@ -57,8 +57,6 @@ static void set_op_mem(cs_hppa *hppa, uint32_t base, uint32_t space, cs_ac_type struct pa_insn_fmt { - // unsigned long int match; - // unsigned long int mask; hppa_insn insn_id; const char *format; bool is_alternative; ///< true if some completer affects the instruction format @@ -505,7 +503,6 @@ static void print_modifiers(MCInst *MI, struct SStream *O) void HPPA_printInst(MCInst *MI, struct SStream *O, void *Info) { - // cs_insn insn; cs_hppa hppa; /* set pubOpcode as instruction id */