~ chicken-core (chicken-5) e1a54378d3481147f38519a9b14285ba84c7864e


commit e1a54378d3481147f38519a9b14285ba84c7864e
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Nov 14 14:30:36 2011 +0100
Commit:     Christian Kellermann <ckeen@pestilenz.org>
CommitDate: Mon Nov 14 15:02:19 2011 +0100

    when conditional branches differ in the number of results, do not merge the results
    
    Instead treat the expression as returning an undetermined number of
    unknown results.
    
    Bugfix for #680
    
    Signed-off-by: Christian Kellermann <ckeen@pestilenz.org>

diff --git a/scrutinizer.scm b/scrutinizer.scm
index 18543035..2f8ed8f0 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -500,15 +500,16 @@
 				   (add-to-blist (caar ble) (car flow) (cdr ble))))
 			       blist)))
 			  (cond ((and (not (eq? '* r1)) (not (eq? '* r2)))
-				 (when (and (not nor1) (not nor2)
-					    (not (= (length r1) (length r2))))
-				   (report 
-				    loc
-				    (sprintf
-					"branches in conditional expression differ in the number of results:~%~%~a"
-				      (pp-fragment n))))
 				 ;;(dd " branches: ~s:~s / ~s:~s" nor1 r1 nor2 r2)
-				 (cond (nor1 r2)
+				 (cond ((and (not nor1) (not nor2)
+					     (not (= (length r1) (length r2))))
+					(report 
+					 loc
+					 (sprintf
+					     "branches in conditional expression differ in the number of results:~%~%~a"
+					   (pp-fragment n)))
+					'*)
+				       (nor1 r2)
 				       (nor2 r1)
 				       (else
 					(dd "merge branch results: ~s + ~s" r1 r2)
Trap