Commit fdd3dcfa authored by Stefan Monnier's avatar Stefan Monnier

* src/alloc.c (sweep_symbols): Tweak last change

Avoid the double-free without the extra check.  Add an explanatory comment.
parent 27964af4
...@@ -7024,10 +7024,16 @@ sweep_symbols (void) ...@@ -7024,10 +7024,16 @@ sweep_symbols (void)
{ {
if (!sym->s.gcmarkbit) if (!sym->s.gcmarkbit)
{ {
if (sym->s.redirect == SYMBOL_LOCALIZED if (sym->s.redirect == SYMBOL_LOCALIZED)
/* Already freed? */ {
&& !EQ (sym->s.function, Vdead)) xfree (SYMBOL_BLV (&sym->s));
xfree (SYMBOL_BLV (&sym->s)); /* At every GC we sweep all symbol_blocks and rebuild the
symbol_free_list, so those symbols which stayed unused
between the two will be re-swept.
So we have to make sure we don't re-free this blv next
time we sweep this symbol_block (bug#29066). */
sym->s.redirect == SYMBOL_PLAINVAL;
}
sym->s.next = symbol_free_list; sym->s.next = symbol_free_list;
symbol_free_list = &sym->s; symbol_free_list = &sym->s;
symbol_free_list->function = Vdead; symbol_free_list->function = Vdead;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment