]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Qunbound-Qnil confusion in clrhash patch
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Aug 2019 08:22:10 +0000 (01:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Aug 2019 08:22:52 +0000 (01:22 -0700)
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.

src/fns.c

index 8ca0953fe85d99402feed6f114c718932bd4fe63..4fb33500bf53f2a780b8fa106d7fcb5b1424bd81 100644 (file)
--- 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));