diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-07-20 23:42:06 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-07-20 23:42:06 -0400 |
commit | bcbdf3f2c90897769394d6d0d23e7714ec471d4f (patch) | |
tree | f6a502ceef78106d3348cbac298193293e718f42 /eval.c | |
parent | 4242283189a94a79dda78540efe78b2666a944cc (diff) | |
download | bfs-bcbdf3f2c90897769394d6d0d23e7714ec471d4f.tar.xz |
eval: Add some sanity checks
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; } |