diff options
| author | Paul Eggert | 2019-08-22 01:22:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-22 01:22:52 -0700 |
| commit | e5defc3e0fc753231d04db514d650c731d12bf1e (patch) | |
| tree | 952e26aaf0f41377e8c53c941fc232a748ad8b4a /src | |
| parent | 7d15079c7e819dd7862b3f35df16e175802ca7a2 (diff) | |
| download | emacs-e5defc3e0fc753231d04db514d650c731d12bf1e.tar.gz emacs-e5defc3e0fc753231d04db514d650c731d12bf1e.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -4406,9 +4406,12 @@ hash_clear (struct Lisp_Hash_Table *h) | |||
| 4406 | ptrdiff_t size = HASH_TABLE_SIZE (h); | 4406 | ptrdiff_t size = HASH_TABLE_SIZE (h); |
| 4407 | if (!hash_rehash_needed_p (h)) | 4407 | if (!hash_rehash_needed_p (h)) |
| 4408 | memclear (XVECTOR (h->hash)->contents, size * word_size); | 4408 | memclear (XVECTOR (h->hash)->contents, size * word_size); |
| 4409 | memclear (XVECTOR (h->key_and_value)->contents, size * 2 * word_size); | ||
| 4410 | for (ptrdiff_t i = 0; i < size; i++) | 4409 | for (ptrdiff_t i = 0; i < size; i++) |
| 4411 | set_hash_next_slot (h, i, i < size - 1 ? i + 1 : -1); | 4410 | { |
| 4411 | set_hash_next_slot (h, i, i < size - 1 ? i + 1 : -1); | ||
| 4412 | set_hash_key_slot (h, i, Qunbound); | ||
| 4413 | set_hash_value_slot (h, i, Qnil); | ||
| 4414 | } | ||
| 4412 | 4415 | ||
| 4413 | for (ptrdiff_t i = 0; i < ASIZE (h->index); i++) | 4416 | for (ptrdiff_t i = 0; i < ASIZE (h->index); i++) |
| 4414 | ASET (h->index, i, make_fixnum (-1)); | 4417 | ASET (h->index, i, make_fixnum (-1)); |