Skip to content
Snippets Groups Projects
Commit c231fb42 authored by rtoy's avatar rtoy
Browse files

From Gerd, cmucl-imp, 2005/06/11:

    This week's fix is for something Lynn Quam reported 2004-10-18.

    (defclass a (b) ())

    (compile nil
	     (lambda ()
	       (defclass b ()
		 ((x :reader b-x)))
	       (defmethod f ((obj b))
		 (b-x obj))))
      => error during macro expansion

    The fix is:

	    * src/pcl/method-slot-access-optimization.lisp (check-inline-accessor-call-p):
	    Return nil for forward-referenced classes.

	    * src/pcl/info.lisp (decide-slot-type): Return nil for
	    forward-referenced classes.
parent 1cefe89a
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
;;; GF is actually non-accessor GF. Clean this up. ;;; GF is actually non-accessor GF. Clean this up.
;;; (setf symbol-value) should be handled like (setf fdefinition) ;;; (setf symbol-value) should be handled like (setf fdefinition)
(file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/info.lisp,v 1.10 2005/01/27 14:45:58 rtoy Exp $") (file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/info.lisp,v 1.11 2005/06/14 12:34:59 rtoy Rel $")
(in-package "PCL") (in-package "PCL")
...@@ -227,7 +227,9 @@ ...@@ -227,7 +227,9 @@
(let* ((class (if (symbolp class-or-name) (let* ((class (if (symbolp class-or-name)
(find-class class-or-name nil) (find-class class-or-name nil)
class-or-name)) class-or-name))
(slotd (when class (slotd (when (if (eq *boot-state* 'complete)
(std-class-p class)
class)
(find-slot-definition class slot-name)))) (find-slot-definition class slot-name))))
(when slotd (when slotd
(slot-definition-type slotd))))) (slot-definition-type slotd)))))
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
;;; ;;;
(file-comment (file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/method-slot-access-optimization.lisp,v 1.6 2003/10/29 12:14:35 gerd Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/method-slot-access-optimization.lisp,v 1.7 2005/06/14 12:34:59 rtoy Rel $")
(in-package "PCL") (in-package "PCL")
...@@ -684,9 +684,9 @@ ...@@ -684,9 +684,9 @@
;; ;;
;; Check if CLASS is defined. If not, we can't use inline ;; Check if CLASS is defined. If not, we can't use inline
;; access because we won't be able to determine slot locations. ;; access because we won't be able to determine slot locations.
(unless (classp class) (unless (std-class-p class)
(let ((real-class (find-class class nil))) (let ((real-class (find-class class nil)))
(when (null real-class) (unless (std-class-p real-class)
(when (slot-declaration env 'inline class) (when (slot-declaration env 'inline class)
(cant-optimize class "The class is not defined at compile time")) (cant-optimize class "The class is not defined at compile time"))
(return-from check-inline-accessor-call-p nil)) (return-from check-inline-accessor-call-p nil))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment