diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 312bf298b3..824e5e8aa8 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1408,7 +1408,7 @@ static void decode_RV32_64C0(DisasContext *ctx) switch (funct3) { case 0: /* illegal */ - if (ctx->opcode == 0) { + if (GET_C_ADDI4SPN_IMM(ctx->opcode) == 0) { gen_exception_illegal(ctx); } else { /* C.ADDI4SPN -> addi rd', x2, zimm[9:2]*/