* lhs->call.args->flags.can_purify |= rhs->flags.can_purify | rhs->flags.pure;
* lhs->flags.can_purify = lhs->call.args->flags.can_purify;
*/
- if (!is_truthy(lhs, &value)) return NULL;
+ if (!is_truthy(lhs, &value)) {
+ xlat_exp_t *tmp;
+
+ if (!is_truthy(rhs, &value)) return NULL;
+
+ tmp = lhs;
+ lhs = rhs;
+ rhs = tmp;
+ }
/*
* 1 && FOO --> FOO
#
# More short-circuit evaluations
#
-# @todo - peephole - optimise at parse time
-#
condition (&User-Name == "bob") && (false)
-match ((&User-Name == "bob") && false)
+match false
condition (&User-Name == "bob") || (true)
-match ((&User-Name == "bob") || true)
+match true
#
# A && (B || C) is not the same as (A && B) || C, for 0/1/1