[cmucl-help] Inlined TYPEP over-optimization bug with CHANGE-CLASS

Dan Corkill corkill at gbbopen.org
Sun Feb 5 11:18:21 UTC 2012


Recent CMUCL releases (including the current one), incorrectly over-optimize TYPEP and
miss the class change resulting from CHANGE-CLASS. 

The following example, when placed in a file and compiled, shows the issue:

(in-package :cl-user)

(defclass foo () ())
(defclass bar () ())

(defmethod show-bug ((instance foo))
 (change-class instance 'bar)
 (format t "~&;; Inlined TYPEP: ~s (incorrect)~%;; Not-inlined TYPEP: ~s (correct)~%"
         (typep instance 'foo)
         (locally (declare (notinline typep))
           (typep instance 'foo))))

(show-bug (make-instance 'foo))

-- Dan



More information about the cmucl-help mailing list