diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/thread.c b/src/thread.c index 4c98d590b7a..b5b7d7c0d71 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -790,7 +790,7 @@ run_thread (void *state) | |||
| 790 | xfree (self->m_specpdl - 1); | 790 | xfree (self->m_specpdl - 1); |
| 791 | self->m_specpdl = NULL; | 791 | self->m_specpdl = NULL; |
| 792 | self->m_specpdl_ptr = NULL; | 792 | self->m_specpdl_ptr = NULL; |
| 793 | self->m_specpdl_size = 0; | 793 | self->m_specpdl_end = NULL; |
| 794 | 794 | ||
| 795 | { | 795 | { |
| 796 | struct handler *c, *c_next; | 796 | struct handler *c, *c_next; |
| @@ -862,11 +862,10 @@ If NAME is given, it must be a string; it names the new thread. */) | |||
| 862 | /* Perhaps copy m_last_thing_searched from parent? */ | 862 | /* Perhaps copy m_last_thing_searched from parent? */ |
| 863 | new_thread->m_current_buffer = current_thread->m_current_buffer; | 863 | new_thread->m_current_buffer = current_thread->m_current_buffer; |
| 864 | 864 | ||
| 865 | new_thread->m_specpdl_size = 50; | 865 | ptrdiff_t size = 50; |
| 866 | new_thread->m_specpdl = xmalloc ((1 + new_thread->m_specpdl_size) | 866 | union specbinding *pdlvec = xmalloc ((1 + size) * sizeof (union specbinding)); |
| 867 | * sizeof (union specbinding)); | 867 | new_thread->m_specpdl = pdlvec + 1; /* Skip the dummy entry. */ |
| 868 | /* Skip the dummy entry. */ | 868 | new_thread->m_specpdl_end = new_thread->m_specpdl + size; |
| 869 | ++new_thread->m_specpdl; | ||
| 870 | new_thread->m_specpdl_ptr = new_thread->m_specpdl; | 869 | new_thread->m_specpdl_ptr = new_thread->m_specpdl; |
| 871 | 870 | ||
| 872 | sys_cond_init (&new_thread->thread_condvar); | 871 | sys_cond_init (&new_thread->thread_condvar); |