ADD-DIRECT-SUBCLASS: duplicate CLASSOID-SUBCLASSES

Bug #1903417 reported by Michał "phoe" Herda on 2020-11-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

https://github.com/sbcl/sbcl/blob/532b885acb3da5bf927b600f05d568507075ae3c/src/pcl/std-class.lisp#L183-L184

(defmethod add-direct-subclass ((class class) (subclass class))
  (with-slots (direct-subclasses) class
    (with-world-lock ()
      (pushnew subclass direct-subclasses :test #'eq)
      (let ((layout (class-wrapper subclass)))
        (when layout
          (let* ((classoid (layout-classoid layout)))
            (dovector (super-layout (layout-inherits layout))
              (let* ((super (layout-classoid super-layout))
                     (subclasses (or (classoid-subclasses super)
                                     (or (classoid-subclasses super) ;; isn't this NIL at this point?
                                         (setf (classoid-subclasses super)
                                               (make-hash-table :hash-function #'type-hash-value
                                                                :test 'eq
                                                                :synchronized t))))))
                (when subclasses
                  (setf (gethash classoid subclasses) layout))))))))
    subclass))

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers