1.0.30.26: fix failing AVER in CONVERT-MV-CALL
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 31 Jul 2009 13:00:17 +0000 (13:00 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 31 Jul 2009 13:00:17 +0000 (13:00 +0000)
 See https://bugs.launchpad.net/sbcl/+bug/392203

 Patch by Larry D'Anna.

 His comments:

   Ever since Spice Lisp, convert-mv-call had returned without doing
   anything if (functional-entry-fun fun) is not null, ie if fun
   possesses a XEP. 0.8.5.5 replaces this criterion with "if the last
   optional entry has references", and signals an error if the last
   optional entry has no references and the XEP exists.

   I can't know exactly what Alexy was thinking when he put the aver
   in, but I can guess: If the XEP exists it should contain a
   reference to the last entry point, so if the last entry point has
   no refs and a XEP exists something went wrong. However, if the
   number of required + optional arguments is 0, then XEP doesn't need
   the "last" entry point, it can always use the "more" entry point
   instead, which is exactly what seems to have happened in this case.

   This patch combines the two conditions. convert-mv-call will return
   without action if *either* a XEP exists, *or* the last optional
   entry has references."

NEWS
src/compiler/locall.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index d1b55bb..9988938 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ changes relative to sbcl-1.0.30:
        well.
   * improvement: improved address space layout on OpenBSD (thanks to Josh
     Elsasser)
+  * bug fix: a failing AVER in CONVERT-MV-CALL has been fixed. (thanks to
+    Larry D'Anna)
   * bug fix: SLEEP supports times over 100 million seconds on long on OpenBSD
     as well. (reported by Josh Elsasser)
   * bug fix: DELETE-FILE on streams no longer closes the stream with :ABORT T,
index b274db3..aa84315 100644 (file)
   (declare (type ref ref) (type mv-combination call) (type functional fun))
   (when (and (looks-like-an-mv-bind fun)
              (singleton-p (leaf-refs fun))
-             (singleton-p (basic-combination-args call)))
+             (singleton-p (basic-combination-args call))
+             (not (functional-entry-fun fun)))
     (let* ((*current-component* (node-component ref))
            (ep (optional-dispatch-entry-point-fun
                 fun (optional-dispatch-max-args fun))))
       (when (null (leaf-refs ep))
         (aver (= (optional-dispatch-min-args fun) 0))
-        (aver (not (functional-entry-fun fun)))
         (setf (basic-combination-kind call) :local)
         (sset-adjoin ep (lambda-calls-or-closes (node-home-lambda call)))
         (merge-tail-sets call ep)
index 1c49450..c49d8c4 100644 (file)
     (test `(lambda (x) (declare (double-float x)) (* x 2)) 123.45d0 246.9d0)
     (test `(lambda (x) (declare (double-float x)) (* x 2.0)) 543.21d0 1086.42d0)
     (test `(lambda (x) (declare (double-float x)) (* x 2.0d0)) 42.0d0 84.0d0)))
+
+(with-test (:name :bug-392203)
+  ;; Used to hit an AVER in COMVERT-MV-CALL.
+  (assert (zerop
+           (funcall
+            (compile nil
+                     `(lambda ()
+                        (flet ((k (&rest x) (declare (ignore x)) 0))
+                          (multiple-value-call #'k #'k))))))))
index f70c198..c308a2a 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.30.25"
+"1.0.30.26"