X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsharpm.lisp;h=a6288726f620adb8ef3c94ffb2705c19edd3fbca;hb=95591ed483dbb8c0846c129953acac1554f28809;hp=af7994f17d3c540309ad3b4b35ff83539261c742;hpb=5d04a95274c9ddaebbcd6ddffc5d646e2c25598c;p=sbcl.git diff --git a/src/code/sharpm.lisp b/src/code/sharpm.lisp index af7994f..a628872 100644 --- a/src/code/sharpm.lisp +++ b/src/code/sharpm.lisp @@ -256,13 +256,22 @@ (unless (eq old new) (setf (aref data i) new)))))) ((typep tree 'instance) - (do ((i 1 (1+ i)) - (end (%instance-length tree))) - ((= i end)) - (let* ((old (%instance-ref tree i)) - (new (circle-subst old-new-alist old))) - (unless (eq old new) - (setf (%instance-ref tree i) new))))) + (let* ((n-untagged (layout-n-untagged-slots (%instance-layout tree))) + (n-tagged (- (%instance-length tree) n-untagged))) + ;; N-TAGGED includes the layout as well (at index 0), which + ;; we don't grovel. + (do ((i 1 (1+ i))) + ((= i n-tagged)) + (let* ((old (%instance-ref tree i)) + (new (circle-subst old-new-alist old))) + (unless (eq old new) + (setf (%instance-ref tree i) new)))) + (do ((i 0 (1+ i))) + ((= i n-untagged)) + (let* ((old (%raw-instance-ref/word tree i)) + (new (circle-subst old-new-alist old))) + (unless (= old new) + (setf (%raw-instance-ref/word tree i) new)))))) ((typep tree 'funcallable-instance) (do ((i 1 (1+ i)) (end (- (1+ (get-closure-length tree)) sb!vm:funcallable-instance-info-offset)))