diff options
| author | Eli Zaretskii | 2015-08-08 11:12:06 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-08-08 11:12:06 +0300 |
| commit | 7afa4f300b9dc38bf3f33b18fa83bfe35e21a479 (patch) | |
| tree | 032ab5a75ec1ff00cee51ffe6216fceb16a53e6c /src/keyboard.c | |
| parent | 35656b6fa473a4c422875a61d24ebb736c1be4e9 (diff) | |
| download | emacs-7afa4f300b9dc38bf3f33b18fa83bfe35e21a479.tar.gz emacs-7afa4f300b9dc38bf3f33b18fa83bfe35e21a479.zip | |
Support recovery from C stack overflow on MS-Windows
* src/w32fns.c (w32_reset_stack_overflow_guard)
(stack_overflow_handler): New functions for handling C stack
overflow exceptions.
(my_exception_handler): Handle EXCEPTION_STACK_OVERFLOW exceptions
specially, and zero out except_addr if we do.
(globals_of_w32fns): Initialize dwMainThreadId in non-interactive
mode.
* src/sysdep.c [HAVE_STACK_OVERFLOW_HANDLING]: Add !WINDOWSNT to
the condition, as HAVE_STACK_OVERFLOW_HANDLING is now defined for
the MinGW build, but the code guarded by that is for Posix hosts.
* src/keyboard.c (command_loop) [WINDOWSNT]: Call
w32_reset_stack_overflow_guard.
* nt/inc/ms-w32.h (sigjmp_buf): New typedef.
(sigsetjmp): New macro.
(w32_reset_stack_overflow_guard): Declare the prototype.
* configure.ac (HAVE_STACK_OVERFLOW_HANDLING): Set to 1 for MinGW.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 5f8667586c4..e4fe5b9bb4c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1092,7 +1092,11 @@ command_loop (void) | |||
| 1092 | /* At least on GNU/Linux, saving signal mask is important here. */ | 1092 | /* At least on GNU/Linux, saving signal mask is important here. */ |
| 1093 | if (sigsetjmp (return_to_command_loop, 1) != 0) | 1093 | if (sigsetjmp (return_to_command_loop, 1) != 0) |
| 1094 | { | 1094 | { |
| 1095 | /* Comes here from handle_sigsegv, see sysdep.c. */ | 1095 | /* Comes here from handle_sigsegv (see sysdep.c) and |
| 1096 | stack_overflow_handler (see w32fns.c). */ | ||
| 1097 | #ifdef WINDOWSNT | ||
| 1098 | w32_reset_stack_overflow_guard (); | ||
| 1099 | #endif | ||
| 1096 | init_eval (); | 1100 | init_eval (); |
| 1097 | Vinternal__top_level_message = recover_top_level_message; | 1101 | Vinternal__top_level_message = recover_top_level_message; |
| 1098 | } | 1102 | } |