]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix two bad bugs in thread.c.
authorTom Tromey <tromey@redhat.com>
Fri, 11 Sep 2009 17:17:46 +0000 (19:17 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 11 Sep 2009 17:17:46 +0000 (19:17 +0200)
src/thread.c

index 2f47c7e10372b676bb2af3958cf2dd01c27b360d..d19172dcbe52809d6f7c353b1ba02ec033b42b2e 100644 (file)
@@ -205,13 +205,13 @@ When the function exits, the thread dies.  */)
 
   new_thread = (struct thread_state *) allocate_pseudovector (VECSIZE (struct thread_state),
                                                              2, PVEC_THREAD);
-  memset (new_thread, OFFSETOF (struct thread_state,
-                               m_gcprolist),
-         sizeof (struct thread_state) - OFFSETOF (struct thread_state,
-                                                  m_gcprolist));
+  memset ((char *) new_thread + OFFSETOF (struct thread_state, m_gcprolist),
+         0, sizeof (struct thread_state) - OFFSETOF (struct thread_state,
+                                                     m_gcprolist));
 
   new_thread->func = function;
   new_thread->initial_specpdl = Qnil;
+  new_thread->m_current_buffer = current_thread->m_current_buffer;
 
   for (p = specpdl; p != specpdl_ptr; ++p)
     {