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

Re: another mvbind problem?



pg@das.harvard.edu writes:
> I'm using Clisp of 1995-06-23 (June 1995) with the new patch to
> fix the recent mvbind bug, and there seems to be another kind of
> problem with mvbind:
> 
> > (defun foo ()
>     (multiple-value-bind (x y)  (cdr '(a b)) 
>       y))
> FOO
> > (foo)
> NIL
> > (compile 'foo)
> FOO
> > (foo)
> (FOO)

Whee! This is a real compiler bug. Here is a patch and a changelog entry:

* Fixed a bug in the compiler: A (MULTIPLE-VALUE-SETQ vars valform)
  or (MULTIPLE-VALUE-BIND vars valform ...) form was miscompiled if
  valform is known to produce a single value.

diff -c3 clisp/src/compiler.lsp.bak clisp/src/compiler.lsp
*** clisp/src/compiler.lsp.bak  Thu Mar 14 08:22:40 1996
--- clisp/src/compiler.lsp      Fri May  3 12:39:36 1996
***************
*** 10313,10319 ****
                          ) ) )
                          ((VALUES0 NIL) (ersetze2 `(PUSH-NIL ,n)))
                          (t (when (gethash (first (car rechts)) one-value-ops nil)
!                              (erweitere2 `(PUSH) `(PUSH-NIL ,(- n 1)))
                    ) ) ) )  )
                    (PUSH-UNBOUND ; Regel 6
                      (case (first (car rechts))
--- 10313,10319 ----
                          ) ) )
                          ((VALUES0 NIL) (ersetze2 `(PUSH-NIL ,n)))
                          (t (when (gethash (first (car rechts)) one-value-ops nil)
!                              (erweitere2 `(PUSH-NIL ,(- n 1)) `(PUSH))
                    ) ) ) )  )
                    (PUSH-UNBOUND ; Regel 6
                      (case (first (car rechts))


Bruno Haible                                     email: <haible@ilog.fr>
Software Engineer                                phone: +33-1-49083585