bug with equalp hash-table?

Bug #1942424 reported by Nicolas Neuß
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Douglas Katzman

Bug Description

According to the Spec, equalp should not distinguish between arrays depending on element-type and I guess the same should be true for equalp hash tables. Thus the following should probably return T,T:

(let ((table (make-hash-table :test 'equalp)))
  (let ((x (vector 1.0d0 1.0d0))
        (y (make-array 2 :element-type 'double-float :initial-contents '(1.0d0 1.0d0))))
    (setf (gethash x table) t)
    (gethash y table)))

It does so in SBCL 2.0.1. However, in recent SBCLs (I compiled SBCL 2.1.8.7-fb7df1c4d from source) it returns NIL,NIL.

uname -a
Linux mini 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

*features*
(:SWANK :QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :64-BIT :ANSI-CL
 :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE
 :SBCL :UNIX)

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

looks like e63feff826 should have used a psxhash where it used sxhash.
The fix isn't just that though, because to do it so simply would essentially nullify the effect of the change as far as avoiding consing

Douglas Katzman (dougk)
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
Douglas Katzman (dougk)
Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
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.