Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • pw's avatar
    a5b6497a
    From Tim Moore · a5b6497a
    pw authored
    internal-sxhash doesn't deal correctly with strings that have fill
    pointers; consequently, equal hash tables don't work correctly either.
    >From 18c:
    *(defvar foo (make-array 32 :element-type 'base-char :adjustable t
    :fill-pointer 7))
    FOO
    * (setf (subseq foo 0) "typedef")
    "typedef"
    * (sxhash foo)
    182883518
    * (sxhash "typedef")
    194663162
    * (defvar h (make-hash-table :test #'equal))
    H
    * (setf (gethash foo h) 'bar)
    BAR
    * (gethash "typedef" h)
    NIL
    NIL
    
    Attached is a fix.
    Tim
    a5b6497a
    History
    From Tim Moore
    pw authored
    internal-sxhash doesn't deal correctly with strings that have fill
    pointers; consequently, equal hash tables don't work correctly either.
    >From 18c:
    *(defvar foo (make-array 32 :element-type 'base-char :adjustable t
    :fill-pointer 7))
    FOO
    * (setf (subseq foo 0) "typedef")
    "typedef"
    * (sxhash foo)
    182883518
    * (sxhash "typedef")
    194663162
    * (defvar h (make-hash-table :test #'equal))
    H
    * (setf (gethash foo h) 'bar)
    BAR
    * (gethash "typedef" h)
    NIL
    NIL
    
    Attached is a fix.
    Tim