]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't alter shared structure in dumped purecopied hash tables.
authorPip Cet <pipcet@gmail.com>
Wed, 3 Jul 2019 11:48:22 +0000 (11:48 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 9 Jul 2019 20:15:29 +0000 (16:15 -0400)
* src/fns.c (hash_table_rehash): Make sure we're operating on
fresh copies of ->next, ->index, ->hash.

src/fns.c

index 11f5dddc858f7f67673beaa4193fc22ccf0f81b2..7343556ac21ca98ef722916ce95ec10282e10c49 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -4224,6 +4224,12 @@ hash_table_rehash (struct Lisp_Hash_Table *h)
 {
   ptrdiff_t size = HASH_TABLE_SIZE (h);
 
+  /* These structures may have been purecopied and shared
+     (bug#36447).  */
+  h->next = Fcopy_sequence (h->next);
+  h->index = Fcopy_sequence (h->index);
+  h->hash = Fcopy_sequence (h->hash);
+
   /* Recompute the actual hash codes for each entry in the table.
      Order is still invalid.  */
   for (ptrdiff_t i = 0; i < size; ++i)