ADD-DIRECT-SUBCLASS: duplicate CLASSOID-SUBCLASSES

Bug #1903417 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
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))

Revision history for this message
Douglas Katzman (dougk) wrote :

Without an example, I don't know what you're trying to say.
Fixed by https://sourceforge.net/p/sbcl/sbcl/ci/dd4eacbbc5 maybe ?

Revision history for this message
Michał "phoe" Herda (phoe-krk) wrote :

Sorry. I meant these two lines:

                     (subclasses (or (classoid-subclasses super)
                                     (or (classoid-subclasses super)

When I looked at the code, it seemed to me that the doubly-nested call (OR (CLASSOID-SUBCLASSES SUPER) ...) is probably unnecessary.

The current master branch no longer has this code block, so this bugticket no longer applies.

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.