1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00

* src/fns.c (sxhash_bignum): Include sign bit in hash.

This commit is contained in:
Mattias Engdegård 2024-02-23 11:26:45 +01:00
parent 53e60fb004
commit 6a53836a24

View File

@ -5193,7 +5193,7 @@ sxhash_bignum (Lisp_Object bignum)
{
mpz_t const *n = xbignum_val (bignum);
size_t i, nlimbs = mpz_size (*n);
EMACS_UINT hash = 0;
EMACS_UINT hash = mpz_sgn(*n) < 0;
for (i = 0; i < nlimbs; ++i)
hash = sxhash_combine (hash, mpz_getlimbn (*n, i));