chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Problem in call/values in 2.41 for compiled code


From: felix winkelmann
Subject: Re: [Chicken-users] Problem in call/values in 2.41 for compiled code
Date: Tue, 1 Aug 2006 08:03:33 +0200

On 8/1/06, Alejandro Forero Cuervo <address@hidden> wrote:

I think I've stumbled on a bug in Chicken 2.41.  When compiled,

  (call-with-values
    (lambda () (values #f 'foo))
    (lambda (a . rest) rest))

evaluates to the empty list (instead of the expected "(foo)" that it
correctly evaluates to when interpreted or when compiled with 2.3).


A bug in the optimizer:


% darcs diff c-platform.scm
499,507c499,506
<                  (= 2 (length (third (node-parameters val))))
<                  (let ((tmp (gensym))
<                        (tmpk (gensym 'r)) )
<                    (debugging 'x "removing single-valued `call-with-values'"
(node-parameters val))
<                    (make-node
<                     'let (list tmp)
<                     (list (make-node
<                            '##core#lambda
<                            (list (gensym 'f_) #f (list tmpk) 0)
---
                      (let ((llist (third (node-parameters val))))
                        (and (proper-list? llist)
                             (= 2 (length (third (node-parameters val))))
                             (let ((tmp (gensym))
                                   (tmpk (gensym 'r)) )
                               (debugging 'o "removing single-valued 
`call-with-values'" (node-parameters val))
                               (make-node
                                'let (list tmp)
508a508,513
                                       '##core#lambda
                                       (list (gensym 'f_) #f (list tmpk) 0)
                                       (list (make-node
                                              '##core#call '(#t)
                                              (list arg2 cont (varnode tmpk)) ) 
) )
                                      (make-node
510,513c515
<                                   (list arg2 cont (varnode tmpk)) ) ) )
<                           (make-node
<                            '##core#call '(#t)
<                            (list arg1 (varnode tmp)) ) ) ) ) ) ) ) ) ) )
---
                                       (list arg1 (varnode tmp)) ) ) ) ) ) ) ) 
) ) ) ) )

A fixed version will be available via darcs shortly.

thanks for reporting this.


cheers,
felix

--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp




reply via email to

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