emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master e5defc3: Fix Qunbound-Qnil confusion in clrhash pat


From: Paul Eggert
Subject: [Emacs-diffs] master e5defc3: Fix Qunbound-Qnil confusion in clrhash patch
Date: Thu, 22 Aug 2019 04:22:57 -0400 (EDT)

branch: master
commit e5defc3e0fc753231d04db514d650c731d12bf1e
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 src/fns.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/fns.c b/src/fns.c
index 8ca0953..4fb3350 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));



reply via email to

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