summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index d4e945c..61c17a5 100644
--- a/parse.c
+++ b/parse.c
@@ -2568,7 +2568,7 @@ static struct expr *new_and_expr(const struct parser_state *state, struct expr *
debug_opt(state, "-O1: short-circuit: (%s %e %e) <==> %e\n", argv[0], lhs, rhs, lhs);
free_expr(rhs);
return lhs;
- } else if (optlevel >= 2 && rhs->always_false && lhs->pure) {
+ } else if (optlevel >= 2 && lhs->pure && rhs == &expr_false) {
debug_opt(state, "-O2: purity: (%s %e %e) <==> %e\n", argv[0], lhs, rhs, rhs);
free_expr(lhs);
return rhs;
@@ -2664,7 +2664,7 @@ static struct expr *new_or_expr(const struct parser_state *state, struct expr *l
} else if (rhs == &expr_false) {
debug_opt(state, "-O1: disjunctive syllogism: (%s %e %e) <==> %e\n", argv[0], lhs, rhs, lhs);
return lhs;
- } else if (optlevel >= 2 && rhs->always_true && lhs->pure) {
+ } else if (optlevel >= 2 && lhs->pure && rhs == &expr_true) {
debug_opt(state, "-O2: purity: (%s %e %e) <==> %e\n", argv[0], lhs, rhs, rhs);
free_expr(lhs);
return rhs;