diff --git a/src/CHANGELOG b/src/CHANGELOG index be2fbe7c0..820583ae3 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -82,6 +82,9 @@ ECL 9.12.1: - The optimized slot accessors check that the instances are up to date. + - The use of MAKE-INSTANCES-OBSOLETE now forces UPDATE-INSTANCE-FOR-REDEFINED-CLASS + to be invoked even if the slots did not change. + * Sockets: - The socket option TCP_NODELAY option has been fixed: it was improperly using diff --git a/src/clos/change.lsp b/src/clos/change.lsp index 8eed2ab25..137f544af 100644 --- a/src/clos/change.lsp +++ b/src/clos/change.lsp @@ -131,32 +131,31 @@ (discarded-slots '()) (added-slots '()) (property-list '())) - (unless (equal old-slotds new-slotds) - (setf instance (si::allocate-raw-instance instance class (class-size class))) - (si::instance-sig-set instance) - (let* ((new-i 0) - (old-local-slotds (remove :instance old-slotds :test-not #'eq - :key #'slot-definition-allocation)) - (new-local-slotds (remove :instance new-slotds :test-not #'eq - :key #'slot-definition-allocation))) - (declare (fixnum new-i)) - (setq discarded-slots - (set-difference (mapcar #'slot-definition-name old-local-slotds) - (mapcar #'slot-definition-name new-local-slotds))) - (dolist (slot-name discarded-slots) - (let* ((ndx (position slot-name old-local-slotds :key #'slot-definition-name))) - (push (cons slot-name (si::instance-ref old-instance ndx)) - property-list))) - (dolist (new-slot new-local-slotds) - (let* ((name (slot-definition-name new-slot)) - (old-i (position name old-local-slotds :key #'slot-definition-name))) - (if old-i - (si::instance-set instance new-i - (si::instance-ref old-instance old-i)) - (push name added-slots)) - (incf new-i)))) - (update-instance-for-redefined-class instance added-slots - discarded-slots property-list)))) + (setf instance (si::allocate-raw-instance instance class (class-size class))) + (si::instance-sig-set instance) + (let* ((new-i 0) + (old-local-slotds (remove :instance old-slotds :test-not #'eq + :key #'slot-definition-allocation)) + (new-local-slotds (remove :instance new-slotds :test-not #'eq + :key #'slot-definition-allocation))) + (declare (fixnum new-i)) + (setq discarded-slots + (set-difference (mapcar #'slot-definition-name old-local-slotds) + (mapcar #'slot-definition-name new-local-slotds))) + (dolist (slot-name discarded-slots) + (let* ((ndx (position slot-name old-local-slotds :key #'slot-definition-name))) + (push (cons slot-name (si::instance-ref old-instance ndx)) + property-list))) + (dolist (new-slot new-local-slotds) + (let* ((name (slot-definition-name new-slot)) + (old-i (position name old-local-slotds :key #'slot-definition-name))) + (if old-i + (si::instance-set instance new-i + (si::instance-ref old-instance old-i)) + (push name added-slots)) + (incf new-i)))) + (update-instance-for-redefined-class instance added-slots + discarded-slots property-list))) ;;; ---------------------------------------------------------------------- ;;; CLASS REDEFINITION PROTOCOL