summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 1d2da7c..e6664a6 100644
--- a/eval.c
+++ b/eval.c
@@ -911,9 +911,12 @@ static bool eval_expr(struct expr *expr, struct eval_state *state) {
++expr->successes;
}
- assert(!expr->always_true || ret);
- assert(!expr->always_false || !ret);
- assert(!expr->never_returns || *state->quit);
+ if (expr_never_returns(expr)) {
+ assert(*state->quit);
+ } else if (!*state->quit) {
+ assert(!expr->always_true || ret);
+ assert(!expr->always_false || !ret);
+ }
return ret;
}