chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Compilation issue with v4.7.0


From: Felix
Subject: Re: [Chicken-users] Compilation issue with v4.7.0
Date: Mon, 15 Aug 2011 11:20:13 +0200 (CEST)

From: Paul Colby <address@hidden>
Subject: [Chicken-users] Compilation issue with v4.7.0
Date: Fri, 12 Aug 2011 07:56:39 -0700

> Hi,
> I tried the following file as a prelude to doing conditional compilation and 
> ran into the following snag,
> 
> ----------------------------- example.scm -----------------------
> (define A #t)
> (define B 'undefined)
> (if A
>  (set! B 'good)
>  (set! B 'bad))
> (print B)
> ------------------------------ end ----------------------------------
> 
> running csi prints out the expected message 'good'
> compiling using 'csc example.scm' and running the
> executable results in 'undefined' being printed. the
> code generated by 'csc -t example.scm' is given below.
> 

Thanks for reporting this! Here a patch:

diff --git a/optimizer.scm b/optimizer.scm
index 1e30ed4..48b3a86 100644
--- a/optimizer.scm
+++ b/optimizer.scm
@@ -74,7 +74,9 @@
          [(if ##core#cond ##core#switch)
           (scan (first subs) e)
           (touch)
-          (scan-each (cdr subs) e)]
+          (scan (first subs) e)
+          (set! previous '())
+          (scan (second subs) e)]
 
          [(let)
           (scan-each (butlast subs) e)


(also available in the git repository)


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]