diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-06-07 13:50:53 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-06-07 13:50:53 -0400 |
commit | faee855b1e886dacc999e1dccf7f8e2c750f33c6 (patch) | |
tree | 39a45954661114f6bc19227663a490d99c7ddb48 /opt.c | |
parent | a1c8bda52a9c07d32127762ee0c865660a0268ab (diff) | |
download | bfs-faee855b1e886dacc999e1dccf7f8e2c750f33c6.tar.xz |
opt: Make sure facts_when_impure sees *all* impure literals
Diffstat (limited to 'opt.c')
-rw-r--r-- | opt.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -803,6 +803,10 @@ static struct expr *optimize_expr_recursive(struct opt_state *state, struct expr state->facts_when_true = state->facts; state->facts_when_false = state->facts; + if (!expr->rhs && !expr->pure) { + facts_union(state->facts_when_impure, state->facts_when_impure, &state->facts); + } + if (expr->eval == eval_access) { infer_access_facts(state, expr); } else if (expr->eval == eval_acl) { @@ -847,8 +851,6 @@ static struct expr *optimize_expr_recursive(struct opt_state *state, struct expr expr = optimize_or_expr_recursive(state, expr); } else if (expr->eval == eval_comma) { expr = optimize_comma_expr_recursive(state, expr); - } else if (!expr->pure) { - facts_union(state->facts_when_impure, state->facts_when_impure, &state->facts); } if (!expr) { |