From 8d1c5a36af7d18fe4c8c1f894ce7fe9c608e3042 Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Tue, 2 Mar 2010 14:19:52 -0800 Subject: [PATCH] Don't check untaken branches when checking for boolean expression. --- src/sf/object.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sf/object.scm b/src/sf/object.scm index c6155bb54..131863b81 100644 --- a/src/sf/object.scm +++ b/src/sf/object.scm @@ -255,8 +255,10 @@ USA. (cond ((expression/call-to-boolean-predicate? expression)) ((conditional? expression) - (and (expression/boolean? (conditional/consequent expression)) - (expression/boolean? (conditional/alternative expression)))) + (and (or (expression/always-false? (conditional/predicate expression)) + (expression/boolean? (conditional/consequent expression))) + (or (expression/never-false? (conditional/predicate expression)) + (expression/boolean? (conditional/alternative expression))))) ((constant? expression) (or (not (constant/value expression)) @@ -267,7 +269,8 @@ USA. ((disjunction? expression) (and (expression/boolean? (disjunction/predicate expression)) - (expression/boolean? (conditional/alternative expression)))) + (or (expression/never-false? (disjunction/predicate expression)) + (expression/boolean? (conditional/alternative expression))))) ((sequence? expression) (expression/boolean? (last (sequence/actions expression)))) -- 2.25.1