Skip to content

Commit

Permalink
common-lisp: update ubuntu 24.04. Fix key hashing bug.
Browse files Browse the repository at this point in the history
Newer versions of sbcl now have the same sxhash issue on compound types
as the other common lisp implementations. So always dereference the
underlying base type when generating a hash. This fixes the bug in newer
sbcl that was resulting in `get` and `contains?` not working for
hash-maps.
  • Loading branch information
kanaka committed Aug 15, 2024
1 parent b57cd56 commit 412e50e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion impls/common-lisp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04
MAINTAINER Joel Martin <github@martintribe.org>

##########################################################
Expand Down
8 changes: 3 additions & 5 deletions impls/common-lisp/src/types.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,9 @@

(defun make-mal-value-hash-table ()
(unless (gethash 'mal-data-value-hash genhash::*hash-test-designator-map*)
;; ECL, ABCL and MKCL's implementations of sxhash do not work well with
;; compound types, use a custom hash function which hashes the underlying
;; value instead
(let ((hash-function #+(or ecl abcl mkcl) #'mal-sxhash
#-(or ecl abcl mkcl) #'sxhash))
;; sxhash does not work well with compound types, use a custom
;; hash function which hashes the underlying value instead
(let ((hash-function #'mal-sxhash))
(register-test-designator 'mal-data-value-hash
hash-function
#'mal-data-value=)))
Expand Down

0 comments on commit 412e50e

Please sign in to comment.