CMUCL commit: src/pcl (boot.lisp)

Raymond Toy rtoy at common-lisp.net
Thu Mar 4 15:03:31 CET 2010


    Date: Thursday, March 4, 2010 @ 09:03:31
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/pcl

Modified: boot.lisp

Fix issue where CMUCL does not correctly handle FLETs in DEFMETHOD
bodies which use the same name as that of the generic function.  Bug
report and fix from Madhu, cmucl-imp, 2010-02-19.

An example:

(defmethod foo (bar var) 
  (format t "GENERICFOO ~S, ~S.%" bar var))

(defclass fnarr () ())

(defmethod foo ((bar fnarr) var)
  (flet ((foo (&optional arg)
	   (foo var (class-of arg)))) ; gf FOO call
    (foo bar))) ; local function FOO call

;; (incorrect) Error when evaluating 
(foo (make-instance 'fnarr) t)


-----------+
 boot.lisp |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


Index: src/pcl/boot.lisp
diff -u src/pcl/boot.lisp:1.73 src/pcl/boot.lisp:1.74
--- src/pcl/boot.lisp:1.73	Thu Aug 18 12:55:00 2005
+++ src/pcl/boot.lisp	Thu Mar  4 09:03:31 2010
@@ -25,7 +25,7 @@
 ;;; *************************************************************************
 
 (file-comment
- "$Header: /project/cmucl/cvsroot/src/pcl/boot.lisp,v 1.73 2005-08-18 16:55:00 rtoy Rel $")
+ "$Header: /project/cmucl/cvsroot/src/pcl/boot.lisp,v 1.74 2010-03-04 14:03:31 rtoy Exp $")
 
 (in-package :pcl)
 
@@ -1177,7 +1177,8 @@
 		    (optimize-slot-writer form required-parameters slots env))
 		   ;;
 		   ((and (valid-function-name-p (car form))
-			 (info-gf-name-p (car form)))
+			 (info-gf-name-p (car form))
+			 (not (walker::environment-function env (car form))))
 		    (optimize-gf-call form required-parameters calls env))
 		   (t
 		    form))))



More information about the cmucl-commit mailing list