diff --git a/test/unit/test_il_validate.c b/test/unit/test_il_validate.c index 54b9a0f0199..02ac6f44d4d 100644 --- a/test/unit/test_il_validate.c +++ b/test/unit/test_il_validate.c @@ -1086,6 +1086,18 @@ static bool test_il_validate_effect_repeat() { mu_assert_streq_free(report, "Body operand of repeat op does not only perform data effects.", "report"); rz_il_op_effect_free(op); + ////////////////////////// + // malformed effect handling + + op = rz_il_op_new_seqn(2, + rz_il_op_new_set("x", true, rz_il_op_new_bitv_from_ut64(32, 1)), + rz_il_op_new_repeat(rz_il_op_new_non_zero(rz_il_op_new_var("x", RZ_IL_VAR_KIND_LOCAL)), + rz_il_op_new_set("x", true, rz_il_op_new_sub(rz_il_op_new_var("x", RZ_IL_VAR_KIND_LOCAL), rz_il_op_new_b1())))); + val = rz_il_validate_effect(op, ctx, &local_var_sorts, &t, &report); + mu_assert_false(val, "invalid"); + mu_assert_streq_free(report, "Right operand of sub op is not a bitvector.", "report"); + rz_il_op_effect_free(op); + rz_il_validate_global_context_free(ctx); mu_end; }