From a524020258c94100c585f57fa1d95a8c58232ee9 Mon Sep 17 00:00:00 2001 From: billow Date: Wed, 24 Jan 2024 23:12:18 +0800 Subject: [PATCH] fix --- librz/asm/arch/v850/v850_disas.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/librz/asm/arch/v850/v850_disas.c b/librz/asm/arch/v850/v850_disas.c index f09b403ff76..725cfe19930 100644 --- a/librz/asm/arch/v850/v850_disas.c +++ b/librz/asm/arch/v850/v850_disas.c @@ -314,6 +314,9 @@ static bool decode_formatIV_2(V850_Inst *inst) { } static bool decode_formatV(V850_Inst *inst) { + if (inst->w2 & 1) { + return false; + } inst->opcode = get_opcode(inst, 6, 10); inst->reg2 = get_reg2(inst); inst->disp = get_disp22(inst); @@ -392,7 +395,7 @@ static bool decode_formatVII(V850_Inst *inst) { case 0x38: inst->id = V850_LDB; break; case 0x3a: inst->id = V850_STB; break; case 0x3b: - if (!(inst->w2 & 1)) { + if (!(inst->sub_opcode)) { inst->id = V850_STH; } else { inst->id = V850_STW; @@ -400,14 +403,14 @@ static bool decode_formatVII(V850_Inst *inst) { inst->disp &= ~1; break; case 0x3e: { - if (inst->w2 & 1) { + if (inst->sub_opcode) { inst->id = V850_LDBU; break; } return false; } case 0x39: { - if (!(inst->w2 & 1)) { + if (!(inst->sub_opcode)) { inst->id = V850_LDH; } else { inst->id = V850_LDW; @@ -757,7 +760,7 @@ static bool decode_formatXIII(V850_Inst *inst) { inst->list = get_list(inst); inst->reg2 = inst->w2 & 0x1f; - if (inst->sub_opcode == 0) { + if (inst->sub_opcode != 0) { return false; }