gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] notinline functions lose secondary values


From: Camm Maguire
Subject: Re: [Gcl-devel] notinline functions lose secondary values
Date: Thu, 07 Apr 2011 12:42:41 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Greetings, and thanks!  Fixed in cvs:

Index: gcl_cmpcall.lsp
===================================================================
RCS file: /sources/gcl/gcl/cmpnew/gcl_cmpcall.lsp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -u -r1.27 -r1.28
--- gcl_cmpcall.lsp     16 Dec 2007 08:56:40 -0000      1.27
+++ gcl_cmpcall.lsp     4 Apr 2011 15:36:01 -0000       1.28
@@ -662,6 +662,7 @@
                   (wt-nl loc "=(" (vv-str (add-symbol fname)) "->s.s_gfdef);"))
               (push-args-lispcall args)
               (cond ((or (eq *value-to-go* 'return)
+                        (multiple-values-p)
                         (rassoc *value-to-go* +return-alist+)
                          (eq *value-to-go* 'top))
                      (wt-nl "lispcall")
@@ -680,6 +681,7 @@
          (let ((base *vs*))
               (push-args-lispcall args)
               (cond ((or (eq *value-to-go* 'return)
+                        (multiple-values-p)
                         (rassoc *value-to-go* +return-alist+)
                          (eq *value-to-go* 'top))
                      (wt-nl "symlispcall")


Faré <address@hidden> writes:

> Reduced test case. Using GCL 2.7.0 in ANSI mode.
>
> (load (compile "bug.lisp"))
>
> ;;; bug.lisp contents follow:
>
> (in-package :cl-user)
>
> (defun bar (x)
>   (values x x))
> (declaim (notinline bar))
> (defun foo (x)
>   (multiple-value-bind (a b) (bar x)
>     (list a b)))
> (format t "~&~S~%" (foo 1)) ;==> (1 NIL) instead of (1 1)
>
> (defun baz (x)
>   (values x x))
> (declaim (inline baz))
> (defun quux (x)
>   (multiple-value-bind (a b) (baz x)
>     (list a b)))
> (format t "~&~S~%" (quux 1)) ;==> (1 1) as expected
>
> [ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
> When you've seen one nuclear war, you've seen them all.
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gcl-devel
>
>
>
>

Take care,
-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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