diff options
| author | Eli Zaretskii | 2016-12-05 20:59:11 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-05 20:59:11 +0200 |
| commit | e4deba098e0281538a0e7b04d849989f17e5bcc7 (patch) | |
| tree | 597ec86397a68d6a73f8ce948ac28abc19b335f6 /src/eval.c | |
| parent | de4624c99ea5bbe38ad5aff7b6461cc5c740d0be (diff) | |
| download | emacs-e4deba098e0281538a0e7b04d849989f17e5bcc7.tar.gz emacs-e4deba098e0281538a0e7b04d849989f17e5bcc7.zip | |
Fix merged code in process.c and eval.c.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c index c08f93aee0c..4405b8bb738 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -3323,15 +3323,24 @@ rebind_for_thread_switch (void) | |||
| 3323 | if (bind->kind >= SPECPDL_LET) | 3323 | if (bind->kind >= SPECPDL_LET) |
| 3324 | { | 3324 | { |
| 3325 | Lisp_Object value = specpdl_saved_value (bind); | 3325 | Lisp_Object value = specpdl_saved_value (bind); |
| 3326 | 3326 | Lisp_Object sym = specpdl_symbol (bind); | |
| 3327 | bool was_trapped = | ||
| 3328 | SYMBOLP (sym) | ||
| 3329 | && XSYMBOL (sym)->trapped_write == SYMBOL_TRAPPED_WRITE; | ||
| 3330 | /* FIXME: This is not clean, and if do_specbind signals an | ||
| 3331 | error, the symbol will be left untrapped. */ | ||
| 3332 | if (was_trapped) | ||
| 3333 | XSYMBOL (sym)->trapped_write = SYMBOL_UNTRAPPED_WRITE; | ||
| 3327 | bind->let.saved_value = Qnil; | 3334 | bind->let.saved_value = Qnil; |
| 3328 | do_specbind (XSYMBOL (specpdl_symbol (bind)), bind, value); | 3335 | do_specbind (XSYMBOL (sym, bind, value, true); |
| 3336 | if (was_trapped) | ||
| 3337 | XSYMBOL (sym)->trapped_write = SYMBOL_TRAPPED_WRITE; | ||
| 3329 | } | 3338 | } |
| 3330 | } | 3339 | } |
| 3331 | } | 3340 | } |
| 3332 | 3341 | ||
| 3333 | static void | 3342 | static void |
| 3334 | do_one_unbind (union specbinding *this_binding, int unwinding) | 3343 | do_one_unbind (union specbinding *this_binding, bool unwinding) |
| 3335 | { | 3344 | { |
| 3336 | eassert (unwinding || this_binding->kind >= SPECPDL_LET); | 3345 | eassert (unwinding || this_binding->kind >= SPECPDL_LET); |
| 3337 | switch (this_binding->kind) | 3346 | switch (this_binding->kind) |
| @@ -3458,7 +3467,7 @@ unbind_to (ptrdiff_t count, Lisp_Object value) | |||
| 3458 | union specbinding this_binding; | 3467 | union specbinding this_binding; |
| 3459 | this_binding = *--specpdl_ptr; | 3468 | this_binding = *--specpdl_ptr; |
| 3460 | 3469 | ||
| 3461 | do_one_unbind (&this_binding, 1); | 3470 | do_one_unbind (&this_binding, true); |
| 3462 | } | 3471 | } |
| 3463 | 3472 | ||
| 3464 | if (NILP (Vquit_flag) && !NILP (quitf)) | 3473 | if (NILP (Vquit_flag) && !NILP (quitf)) |
| @@ -3476,8 +3485,18 @@ unbind_for_thread_switch (struct thread_state *thr) | |||
| 3476 | { | 3485 | { |
| 3477 | if ((--bind)->kind >= SPECPDL_LET) | 3486 | if ((--bind)->kind >= SPECPDL_LET) |
| 3478 | { | 3487 | { |
| 3479 | bind->let.saved_value = find_symbol_value (specpdl_symbol (bind)); | 3488 | Lisp_Object sym = specpdl_symbol (bind); |
| 3480 | do_one_unbind (bind, 0); | 3489 | bool was_trapped = |
| 3490 | SYMBOLP (sym) | ||
| 3491 | && XSYMBOL (sym)->trapped_write == SYMBOL_TRAPPED_WRITE; | ||
| 3492 | bind->let.saved_value = find_symbol_value (sym); | ||
| 3493 | /* FIXME: This is not clean, and if do_one_unbind signals an | ||
| 3494 | error, the symbol will be left untrapped. */ | ||
| 3495 | if (was_trapped) | ||
| 3496 | XSYMBOL (sym)->trapped_write = SYMBOL_UNTRAPPED_WRITE; | ||
| 3497 | do_one_unbind (bind, false); | ||
| 3498 | if (was_trapped) | ||
| 3499 | XSYMBOL (sym)->trapped_write = SYMBOL_TRAPPED_WRITE; | ||
| 3481 | } | 3500 | } |
| 3482 | } | 3501 | } |
| 3483 | } | 3502 | } |