From bed10876dba330b24419a6144dc62db52bb273ab Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 1 Sep 2013 18:43:43 +0300 Subject: Fix crashes when unbind_for_thread_switch signals an error. src/eval.c (unbind_for_thread_switch): Accept a 'struct thread_state *' argument and use specpdl_ptr and specpdl of that thread. Fixes crashes if find_symbol_value signals an error. src/thread.c (post_acquire_global_lock): Update current_thread before calling unbind_for_thread_switch. Pass the previous thread to unbind_for_thread_switch. --- src/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/eval.c') diff --git a/src/eval.c b/src/eval.c index 68a3691ad9b..b8a61590387 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3484,11 +3484,11 @@ unbind_to (ptrdiff_t count, Lisp_Object value) } void -unbind_for_thread_switch (void) +unbind_for_thread_switch (struct thread_state *thr) { union specbinding *bind; - for (bind = specpdl_ptr; bind != specpdl; --bind) + for (bind = thr->m_specpdl_ptr; bind != thr->m_specpdl; --bind) { if (bind->kind >= SPECPDL_LET) { -- cgit v1.2.1