]> git.eshelyaron.com Git - emacs.git/commit
Fix two crashes when a display connection is lost
authorPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 01:26:15 +0000 (09:26 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 01:26:15 +0000 (09:26 +0800)
commit2267b48cac3c8e8a834b4faaa5390f2ad6a54281
treef7c8c635762707535e835a312c1ef45c2e565edd
parent8c252e2326a3f633d281d70d2f9e7e75975ebdab
Fix two crashes when a display connection is lost

This fixes errors caused by invalid error traps being left on
the error handler stack if an IO error causes a non-local exit
out of the protected code, and another crash caused by
delete_frame trying to read async input.

* src/eval.c (unwind_to_catch, push_handler_nosignal): Save and
restore the X error handler stack.
* src/lisp.h (struct handler): [HAVE_X_WINDOWS]: New field
`x_error_handler_depth'.

* src/xterm.c (struct x_error_message_stack): Make string a
regular string.
(x_unwind_errors_to): New function.
(x_error_catcher, x_catch_errors_with_handler)
(x_uncatch_errors_after_check, x_uncatch_errors): Update the
stack depth.
(x_check_errors): Stop manually unwinding since unwind_to_catch
now does that for us.
(x_had_errors_p, x_clear_errors): Update for new type of
`string'.
(x_connection_closed): Block input between just before
delete_frame to when the terminal is unlinked.

* src/xterm.h: Update prototypes.
src/eval.c
src/lisp.h
src/xterm.c
src/xterm.h