aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorEli Zaretskii2013-09-01 18:43:43 +0300
committerEli Zaretskii2013-09-01 18:43:43 +0300
commitbed10876dba330b24419a6144dc62db52bb273ab (patch)
treea5480db866493e1fa7db43bdc2c8b4bbde0ac4a6 /src/eval.c
parente57df8f77901a3964d21c3d57fb6769cf4511dc2 (diff)
downloademacs-bed10876dba330b24419a6144dc62db52bb273ab.tar.gz
emacs-bed10876dba330b24419a6144dc62db52bb273ab.zip
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.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c4
1 files changed, 2 insertions, 2 deletions
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)
3484} 3484}
3485 3485
3486void 3486void
3487unbind_for_thread_switch (void) 3487unbind_for_thread_switch (struct thread_state *thr)
3488{ 3488{
3489 union specbinding *bind; 3489 union specbinding *bind;
3490 3490
3491 for (bind = specpdl_ptr; bind != specpdl; --bind) 3491 for (bind = thr->m_specpdl_ptr; bind != thr->m_specpdl; --bind)
3492 { 3492 {
3493 if (bind->kind >= SPECPDL_LET) 3493 if (bind->kind >= SPECPDL_LET)
3494 { 3494 {