bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32503: 26.1; Byte-compiled functions don't hash consistently


From: Tom Tromey
Subject: bug#32503: 26.1; Byte-compiled functions don't hash consistently
Date: Wed, 22 Aug 2018 19:42:12 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)

Adam> I noticed that byte-compiled functions don't hash consistently.

The Lisp_Vectorlike case in Fequal has a number of special cases which
don't seem to be reflected in sxhash:

        if (OVERLAYP (o1))
[...]
        if (MARKERP (o1))
[...]
        if (WINDOW_CONFIGURATIONP (o1))
[...]
        /* Aside from them, only true vectors, char-tables, compiled
           functions, and fonts (font-spec, font-entity, font-object)
           are sensible to compare, so eliminate the others now.  */

(Bignums and bool vectors are special-cased as well but are handled in
sxhash.)  This is followed by code to loop over the pseudovector's
elements.

However, the Lisp_Vectorlike case in sxhash doesn't do any of this.

Probably there should be a rule that adding a new type should
necessitate adding a new hasher (much like how print syntax is needed);
or certainly if the type has non-trivial equal behavior.

Tom





reply via email to

[Prev in Thread] Current Thread [Next in Thread]