0.9.9.10:
authorChristophe Rhodes <csr21@cam.ac.uk>
Sun, 29 Jan 2006 22:15:26 +0000 (22:15 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Sun, 29 Jan 2006 22:15:26 +0000 (22:15 +0000)
Fix a bug in ctor optimization reported by kpreid on #lisp
... quote the ctor-initarg keys in the fallback (unoptimized)
constructor too.

NEWS
src/pcl/ctor.lisp
tests/clos.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 9b03a4f..920fd6d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,10 @@ changes in sbcl-0.9.10 relative to sbcl-0.9.9:
   * fixed bug: DOCUMENTATION on structures no longer signals an 
     error if no structure type of the right name exists.  (reported by
     Glenn Ehrlich)
+  * fixed bug: compiled calls to MAKE-INSTANCE where there is an
+    applicable non-standard primary or :AROUND method on
+    INITIALIZE-INSTANCE or SHARED-INITIALIZE and a non-keyword initarg
+    no longer cause unbound variable errors.  (reported by Kevin Reid)
 
 changes in sbcl-0.9.9 relative to sbcl-0.9.8:
   * new platform: experimental support for the Windows operating
index 9ae7add..68ab005 100644 (file)
      ;; calling it with a class, as here, we inhibit the optimization,
      ;; so removing the possibility of endless recursion.  -- CSR,
      ;; 2004-07-12
-     (make-instance ,(ctor-class ctor) ,@(ctor-initargs ctor))))
+     (make-instance ,(ctor-class ctor)
+      ,@(quote-plist-keys (ctor-initargs ctor)))))
 
 (defun optimizing-generator (ctor ii-methods si-methods)
   (multiple-value-bind (locations names body before-method-p)
index 100407d..19c9102 100644 (file)
 (let ((instance (make-instance 'slot-type-subclass)))
   (setf (slot-value instance 'slot) 3))
 \f
+;;; ctors where there's a non-standard SHARED-INITIALIZE method and an
+;;; initarg which isn't self-evaluating (kpreid on #lisp 2006-01-29)
+(defclass kpreid-enode ()
+  ((slot :initarg not-a-keyword)))
+(defmethod shared-initialize ((o kpreid-enode) slots &key &allow-other-keys)
+  (call-next-method))
+(defun make-kpreid-enode ()
+  (make-instance 'kpreid-enode 'not-a-keyword 3))
+(with-test (:name (:ctor :non-keyword-initarg))
+  (let ((x (make-kpreid-enode))
+        (y (make-kpreid-enode)))
+    (= (slot-value x 'slot) (slot-value y 'slot))))
+\f
 ;;;; success
index 3c0c9de..f703cd9 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".)
-"0.9.9.9"
+"0.9.9.10"