From: Paul Eggert Date: Thu, 22 Aug 2019 08:22:10 +0000 (-0700) Subject: Fix Qunbound-Qnil confusion in clrhash patch X-Git-Tag: emacs-27.0.90~1328^2~137 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e5defc3e0fc753231d04db514d650c731d12bf1e;p=emacs.git Fix Qunbound-Qnil confusion in clrhash patch Problem reported by Stefan Monnier. * src/fns.c (hash_clear): Fix typo I introduced in my previous patch here, by setting keys to Qunbound not Qnil. --- diff --git a/src/fns.c b/src/fns.c index 8ca0953fe85..4fb33500bf5 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4406,9 +4406,12 @@ hash_clear (struct Lisp_Hash_Table *h) ptrdiff_t size = HASH_TABLE_SIZE (h); if (!hash_rehash_needed_p (h)) memclear (XVECTOR (h->hash)->contents, size * word_size); - memclear (XVECTOR (h->key_and_value)->contents, size * 2 * word_size); for (ptrdiff_t i = 0; i < size; i++) - set_hash_next_slot (h, i, i < size - 1 ? i + 1 : -1); + { + set_hash_next_slot (h, i, i < size - 1 ? i + 1 : -1); + set_hash_key_slot (h, i, Qunbound); + set_hash_value_slot (h, i, Qnil); + } for (ptrdiff_t i = 0; i < ASIZE (h->index); i++) ASET (h->index, i, make_fixnum (-1));