Fix bug in SB-PCL::COMPUTE-CLASS-SLOTS, exposed by CHANGE-CLASS.
... test case
... this bug fix means that we no longer have to walk the
inherits vector looking for class slots from
superclasses, hooray.
;;;; -*- coding: utf-8; -*-
changes in sbcl-0.9.15 relative to sbcl-0.9.14:
- * added support for the ucs-2 external format (contributed by Ivan Boldyrev)
+ * added support for the ucs-2 external format. (contributed by Ivan
+ Boldyrev)
* minor incompatible change: pretty printing of objects of type
(cons symbol) is, in the default pprint-dispatch-table, now
sensitive to whether the symbol satisfies FBOUNDP. (thanks to
Marcus Pearce)
* fixed bug: FILE-POSITION sometimes returned inconsistent results
- for multibyte external-format streams (thanks to "vbzoli")
+ for multibyte external-format streams. (thanks to "vbzoli")
+ * fixed bug: CHANGE-CLASS would fail to preserve the values of slots
+ with :ALLOCATION :CLASS inherited from superclasses of the
+ original class.
changes in sbcl-0.9.14 relative to sbcl-0.9.13:
* feature: thread support on Solaris/x86, and experimental thread support
(defun compute-class-slots (eslotds)
(let (collect)
- (dolist (eslotd eslotds)
- (push (assoc (slot-definition-name eslotd)
- (class-slot-cells (slot-definition-class eslotd)))
- collect))
- (nreverse collect)))
+ (dolist (eslotd eslotds (nreverse collect))
+ (let ((cell (assoc (slot-definition-name eslotd)
+ (class-slot-cells
+ (slot-definition-allocation-class eslotd)))))
+ (aver cell)
+ (push cell collect)))))
(defun update-gfs-of-class (class)
(when (and (class-finalized-p class)
;; -- --> local add slot
;; -- --> shared --
- ;; Collect class slots from inherited wrappers. Needed for
- ;; shared -> local transfers of inherited slots.
- (let ((inherited (layout-inherits owrapper)))
- (loop for i from (1- (length inherited)) downto 0
- for layout = (aref inherited i)
- when (typep layout 'wrapper)
- do (dolist (slot (wrapper-class-slots layout))
- (pushnew slot oclass-slots :key #'car))))
-
;; Go through all the old local slots.
(let ((opos 0))
(dolist (name olayout)
(defmethod class-as-specializer-test2 ((x ,(find-class 'class-as-specializer-test)))
'bar))))
(assert (eq 'bar (class-as-specializer-test2 (make-instance 'class-as-specializer-test))))
-
+\f
+;;; CHANGE-CLASS and tricky allocation.
+(defclass foo ()
+ ((a :allocation :class :initform 1)))
+(defclass bar (foo) ())
+(defvar *bar* (make-instance 'bar))
+(defclass baz ()
+ ((a :allocation :instance :initform 2)))
+(change-class *bar* 'baz)
+(assert (= (slot-value *bar* 'a) 1))
\f
;;;; success
;;; 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.14.11"
+"0.9.14.12"