From ea7b5d5af6c3f994b10caa80c7f41964678eb2bb Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Mon, 20 Dec 2021 16:49:14 +1000 Subject: [PATCH] target/riscv: Set the opcode in DisasContext Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson Reviewed-by: Bin Meng Message-id: 20211220064916.107241-2-alistair.francis@opensource.wdc.com --- target/riscv/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 4ae4345691..9e4f9c3342 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -846,6 +846,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode) if (!has_ext(ctx, RVC)) { gen_exception_illegal(ctx); } else { + ctx->opcode = opcode; ctx->pc_succ_insn = ctx->base.pc_next + 2; if (!decode_insn16(ctx, opcode)) { gen_exception_illegal(ctx); @@ -856,6 +857,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode) opcode32 = deposit32(opcode32, 16, 16, translator_lduw(env, &ctx->base, ctx->base.pc_next + 2)); + ctx->opcode = opcode32; ctx->pc_succ_insn = ctx->base.pc_next + 4; if (!decode_insn32(ctx, opcode32)) { gen_exception_illegal(ctx); -- 2.30.2