summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/thread.c b/src/thread.c
index 21f74b7696f..a8e79e8377d 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -707,8 +707,10 @@ If NAME is given, it names the new thread. */)
new_thread->event_object = Qnil;
new_thread->m_specpdl_size = 50;
- new_thread->m_specpdl = xmalloc (new_thread->m_specpdl_size
- * sizeof (struct specbinding));
+ new_thread->m_specpdl = xmalloc ((1 + new_thread->m_specpdl_size)
+ * sizeof (union specbinding));
+ /* Skip the dummy entry. */
+ ++new_thread->m_specpdl;
new_thread->m_specpdl_ptr = new_thread->m_specpdl;
sys_cond_init (&new_thread->thread_condvar);