summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-07-20 23:42:06 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-07-20 23:42:06 -0400
commitbcbdf3f2c90897769394d6d0d23e7714ec471d4f (patch)
treef6a502ceef78106d3348cbac298193293e718f42 /eval.c
parent4242283189a94a79dda78540efe78b2666a944cc (diff)
downloadbfs-bcbdf3f2c90897769394d6d0d23e7714ec471d4f.tar.xz
eval: Add some sanity checks
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index b095279..34ccba8 100644
--- a/eval.c
+++ b/eval.c
@@ -858,6 +858,8 @@ static bool eval_expr(struct expr *expr, struct eval_state *state) {
}
}
+ assert(!*state->quit);
+
bool ret = expr->eval(expr, state);
if (time) {
@@ -871,6 +873,10 @@ 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);
+
return ret;
}