diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-11-01 13:36:58 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-11-02 10:03:16 -0400 |
| commit | fdd3dcfa4eb0a4b17bb43f461a6790f68e76da41 (patch) | |
| tree | 98aa3600bec8eb747d855f671a289d7c319193e7 /src/alloc.c | |
| parent | 27964af438c9a25dedd2e7bccb1a11ddfe679858 (diff) | |
| download | emacs-fdd3dcfa4eb0a4b17bb43f461a6790f68e76da41.tar.gz | |
* src/alloc.c (sweep_symbols): Tweak last change
Avoid the double-free without the extra check. Add an explanatory comment.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c index 11afdfd7cc0..3f4ec168fa3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7024,10 +7024,16 @@ sweep_symbols (void) { if (!sym->s.gcmarkbit) { - if (sym->s.redirect == SYMBOL_LOCALIZED - /* Already freed? */ - && !EQ (sym->s.function, Vdead)) - xfree (SYMBOL_BLV (&sym->s)); + if (sym->s.redirect == SYMBOL_LOCALIZED) + { + 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; symbol_free_list = &sym->s; symbol_free_list->function = Vdead; |
