diff options
| author | Stefan Monnier | 2017-11-01 13:36:58 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2017-11-02 10:03:16 -0400 |
| commit | fdd3dcfa4eb0a4b17bb43f461a6790f68e76da41 (patch) | |
| tree | 98aa3600bec8eb747d855f671a289d7c319193e7 /src | |
| parent | 27964af438c9a25dedd2e7bccb1a11ddfe679858 (diff) | |
| download | emacs-fdd3dcfa4eb0a4b17bb43f461a6790f68e76da41.tar.gz emacs-fdd3dcfa4eb0a4b17bb43f461a6790f68e76da41.zip | |
* src/alloc.c (sweep_symbols): Tweak last change
Avoid the double-free without the extra check. Add an explanatory comment.
Diffstat (limited to 'src')
| -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) | |||
| 7024 | { | 7024 | { |
| 7025 | if (!sym->s.gcmarkbit) | 7025 | if (!sym->s.gcmarkbit) |
| 7026 | { | 7026 | { |
| 7027 | if (sym->s.redirect == SYMBOL_LOCALIZED | 7027 | if (sym->s.redirect == SYMBOL_LOCALIZED) |
| 7028 | /* Already freed? */ | 7028 | { |
| 7029 | && !EQ (sym->s.function, Vdead)) | 7029 | xfree (SYMBOL_BLV (&sym->s)); |
| 7030 | xfree (SYMBOL_BLV (&sym->s)); | 7030 | /* At every GC we sweep all symbol_blocks and rebuild the |
| 7031 | symbol_free_list, so those symbols which stayed unused | ||
| 7032 | between the two will be re-swept. | ||
| 7033 | So we have to make sure we don't re-free this blv next | ||
| 7034 | time we sweep this symbol_block (bug#29066). */ | ||
| 7035 | sym->s.redirect == SYMBOL_PLAINVAL; | ||
| 7036 | } | ||
| 7031 | sym->s.next = symbol_free_list; | 7037 | sym->s.next = symbol_free_list; |
| 7032 | symbol_free_list = &sym->s; | 7038 | symbol_free_list = &sym->s; |
| 7033 | symbol_free_list->function = Vdead; | 7039 | symbol_free_list->function = Vdead; |