[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Wierd diagnostic, and gripe!
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] Wierd diagnostic, and gripe! |
Date: |
Mon, 14 Feb 2005 22:57:51 +0100 |
On Mon, 14 Feb 2005 10:54:22 +0000, Julian Morrison
<address@hidden> wrote:
> felix winkelmann wrote:
>
> >This looks more like a bug in the compiler. Can you send me the
> >code, or a snippet containing code that triggers this behaviour?
> >
> >
You found a genuine (and nasty) bug in the optimizer: The call to
pop3-exception in line 113 was missing an argument, and the optimizer
(while heavily reconstructing the argument list for pop3-exception)
stumbled over this.
Here is a patch for optimizer.scm. In case you don't want to mess with
the sources, you can alternatively download a new development
snapshot at:
http://www.call-with-current-continuation.org/chicken-1.92.tar.gz
cd /home/felix/chicken/
diff -c /home/felix/chicken/optimizer.scm.\~1.19.\~
/home/felix/chicken/optimizer.scm
*** /home/felix/chicken/optimizer.scm.~1.19.~ 2004-07-25
06:42:32.000000000 +0200
--- /home/felix/chicken/optimizer.scm 2005-02-14 22:18:58.000000000 +0100
***************
*** 336,359 ****
[(and (test (first (node-parameters lval))
'explicit-rest)
(not (memq n rest-consers)) ) ; make
sure we haven't inlined
rest-list already
(let ([n (length (third (node-parameters
lval)))])
! (debugging 'o "consed rest parameter at
call site" var n)
! (let-values ([(args rargs) (split-at args
n)])
! (let ([n2 (make-node
! '##core#call
! params
! (map walk
! (cons fun
! (append
! args
! (list
! (if (null? rargs)
! (qnode '())
! (make-node
!
'##core#inline_allocate
! (list
"C_a_i_list" (* 3 (length rargs)))
! rargs) ) )
) ) ) ) ] )
! (set! rest-consers (cons n2
rest-consers))
! n2) ) ) ]
[else (walk-generic n class params subs)] ) )
) ]
[else (walk-generic n class params subs)] ) ) ]
[(##core#lambda)
--- 336,362 ----
[(and (test (first (node-parameters lval))
'explicit-rest)
(not (memq n rest-consers)) ) ; make
sure we haven't inlined
rest-list already
(let ([n (length (third (node-parameters
lval)))])
! (if (< (length args) n)
! (walk-generic n class params subs)
! (begin
! (debugging 'o "consed rest parameter
at call site" var n)
! (let-values ([(args rargs) (split-at
args n)])
! (let ([n2 (make-node
! '##core#call
! params
! (map walk
! (cons fun
! (append
! args
! (list
! (if (null?
rargs)
! (qnode
'())
!
(make-node
!
'##core#inline_allocate
! (list
"C_a_i_list" (* 3 (length rargs)))
!
rargs) ) ) ) ) ) ) ] )
! (set! rest-consers (cons n2
rest-consers))
! n2) ) ) ) ) ]
[else (walk-generic n class params subs)] ) )
) ]
[else (walk-generic n class params subs)] ) ) ]
[(##core#lambda)
cheers,
felix