Skip to content
Snippets Groups Projects
Commit b3ef69ef authored by pmai's avatar pmai
Browse files

Entomotomy Bug: sxhash-on-pcl-instances-returns-42

This commit is a slight rewrite of the previously committed fix, which
sxhash-instance work even when handed non-PCL instances and
funcallable-instances, while enabling the use of stored hash-codes for
all PCL funcallable-instances.
parent 5f069f45
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.19 2002/11/21 21:24:13 pmai Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.20 2002/11/28 00:51:34 pmai Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -914,6 +914,7 @@
(internal-sxhash (class-name (layout-class (%instance-layout s-expr)))
depth)
(sxhash-instance s-expr)))
(funcallable-instance (sxhash-instance s-expr))
;; Other-pointer types.
(simple-string (sxhash-simple-string s-expr))
(symbol (sxhash-simple-string (symbol-name s-expr)))
......
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash.lisp,v 1.40 2002/11/21 21:24:14 pmai Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash.lisp,v 1.41 2002/11/28 00:51:34 pmai Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -875,6 +875,7 @@
(internal-sxhash (class-name (layout-class (%instance-layout s-expr)))
depth)
(sxhash-instance s-expr)))
(funcallable-instance (sxhash-instance s-expr))
;; Other-pointer types.
(simple-string (sxhash-simple-string s-expr))
(symbol (sxhash-simple-string (symbol-name s-expr)))
......
......@@ -26,7 +26,7 @@
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fin.lisp,v 1.18 2002/11/22 15:20:18 pmai Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fin.lisp,v 1.19 2002/11/28 00:51:35 pmai Exp $")
;;;
;;
......@@ -170,6 +170,11 @@ explicitly marked saying who wrote it.
;;; Implement proper sxhashing of standard instances.
(defun common-lisp::sxhash-instance (instance)
(cond
((std-instance-p instance) (std-instance-hash-code instance))
((fsc-instance-p instance) (fsc-instance-hash-code instance))
(t (error "What kind of instance is this?"))))
((and (std-instance-p instance)
(typep (std-instance-wrapper instance) 'wrapper))
(std-instance-hash-code instance))
((and (fsc-instance-p instance)
(typep (fsc-instance-wrapper instance) 'wrapper))
(fsc-instance-hash-code instance))
(t
42)))
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