1.0.47.16: more ((LAMBDA ..) ..) and (FUNCALL (LAMBDA ..) ..) equivalence
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 8 Apr 2011 13:06:38 +0000 (13:06 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 8 Apr 2011 13:06:38 +0000 (13:06 +0000)
  This was mostly the case already, but for consistency's sake convert
  ((LAMBDA ...) ...) via (%FUNCALL ...) instead of using
  IR1-CONVERT-COMBINATION directly.

  Fixes lp#720382.

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

diff --git a/NEWS b/NEWS
index 6092a89..17e3c94 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ changes relative to sbcl-1.0.47:
     functions. (lp#740717)
   * bug fix: missed optimizations for (FUNCALL (LAMBDA ...) ...) in
     comparison to (FUNCALL #'(LAMBDA ...) ...).
+  * bug fix: ((LAMBDA ...) ...) forms with invalid argument counts
+    resulted in a compile-time error. (lp#720382)
 
 changes in sbcl-1.0.47 relative to sbcl-1.0.46:
   * bug fix: fix mach port rights leaks in mach exception handling code on
index a46f8ad..3ad34a6 100644 (file)
         (t
          ;; implicitly (LAMBDA ..) because the LAMBDA expression is
          ;; the CAR of an executed form.
-         (ir1-convert-combination
-          start next result form
-          (ir1-convert-lambda op
-                              :debug-name (debug-name 'inline-lambda op))))))
+         (ir1-convert start next result `(%funcall ,@form)))))
 
 ;;; Convert anything that looks like a global function call.
 (defun ir1-convert-global-functoid (start next result form fun)
index 77fa813..ba8d33f 100644 (file)
                         (+ x (funcall (lambda (z) z) y))))
             :type 'function))))
 
+(with-test (:name :bug-720382)
+  (let ((w 0))
+    (let ((f
+           (handler-bind (((and warning (not style-warning))
+                           (lambda (c) (incf w))))
+             (compile nil `(lambda (b) ((lambda () b) 1))))))
+      (assert (= w 1))
+      (assert (eq :error
+                  (handler-case (funcall f 0)
+                    (error () :error)))))))
+
 ;;; This doesn't test LVAR-FUN-IS directly, but captures it
 ;;; pretty accurately anyways.
 (with-test (:name :lvar-fun-is)
index 25c1fbd..a7909c4 100644 (file)
@@ -20,4 +20,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.47.15"
+"1.0.47.16"