diff options
| author | Eli Zaretskii | 2018-10-17 18:19:47 +0300 |
|---|---|---|
| committer | Andreas Schwab | 2019-06-10 12:52:31 +0200 |
| commit | fdd1b3e02097966e7ffe8065f6e3d27f5f540d0a (patch) | |
| tree | 7163eaff57ea41c4a081bd2aff38845985d9a250 /src | |
| parent | 758e9a8ed49c15f7069a67cf0c2ce3c6f9a3f7e1 (diff) | |
| download | emacs-fdd1b3e02097966e7ffe8065f6e3d27f5f540d0a.tar.gz emacs-fdd1b3e02097966e7ffe8065f6e3d27f5f540d0a.zip | |
Avoid assertion violation when comparing with main-thread
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)
* test/src/thread-tests.el (threads-test-bug33073): New test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/thread.c | 6 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 6aeac140ca0..1a72941cc92 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6003,6 +6003,8 @@ garbage_collect_1 (void *end) | |||
| 6003 | VECTOR_UNMARK (&buffer_defaults); | 6003 | VECTOR_UNMARK (&buffer_defaults); |
| 6004 | VECTOR_UNMARK (&buffer_local_symbols); | 6004 | VECTOR_UNMARK (&buffer_local_symbols); |
| 6005 | 6005 | ||
| 6006 | unmark_main_thread (); | ||
| 6007 | |||
| 6006 | check_cons_list (); | 6008 | check_cons_list (); |
| 6007 | 6009 | ||
| 6008 | gc_in_progress = 0; | 6010 | gc_in_progress = 0; |
diff --git a/src/lisp.h b/src/lisp.h index 782c396dbb4..24551699328 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3975,6 +3975,7 @@ extern void syms_of_module (void); | |||
| 3975 | 3975 | ||
| 3976 | /* Defined in thread.c. */ | 3976 | /* Defined in thread.c. */ |
| 3977 | extern void mark_threads (void); | 3977 | extern void mark_threads (void); |
| 3978 | extern void unmark_main_thread (void); | ||
| 3978 | 3979 | ||
| 3979 | /* Defined in editfns.c. */ | 3980 | /* Defined in editfns.c. */ |
| 3980 | extern void insert1 (Lisp_Object); | 3981 | extern void insert1 (Lisp_Object); |
diff --git a/src/thread.c b/src/thread.c index 0cd1ae33dc2..47f55e7f67c 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -656,6 +656,12 @@ mark_threads (void) | |||
| 656 | flush_stack_call_func (mark_threads_callback, NULL); | 656 | flush_stack_call_func (mark_threads_callback, NULL); |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | void | ||
| 660 | unmark_main_thread (void) | ||
| 661 | { | ||
| 662 | main_thread.header.size &= ~ARRAY_MARK_FLAG; | ||
| 663 | } | ||
| 664 | |||
| 659 | 665 | ||
| 660 | 666 | ||
| 661 | static void | 667 | static void |