aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorEli Zaretskii2015-08-08 11:12:06 +0300
committerEli Zaretskii2015-08-08 11:12:06 +0300
commit7afa4f300b9dc38bf3f33b18fa83bfe35e21a479 (patch)
tree032ab5a75ec1ff00cee51ffe6216fceb16a53e6c /src/sysdep.c
parent35656b6fa473a4c422875a61d24ebb736c1be4e9 (diff)
downloademacs-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/sysdep.c')
-rw-r--r--src/sysdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index df3e573a6ea..25f111ad0ed 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1612,7 +1612,7 @@ handle_arith_signal (int sig)
1612 xsignal0 (Qarith_error); 1612 xsignal0 (Qarith_error);
1613} 1613}
1614 1614
1615#ifdef HAVE_STACK_OVERFLOW_HANDLING 1615#if defined HAVE_STACK_OVERFLOW_HANDLING && !defined WINDOWSNT
1616 1616
1617/* Alternate stack used by SIGSEGV handler below. */ 1617/* Alternate stack used by SIGSEGV handler below. */
1618 1618
@@ -1708,7 +1708,7 @@ init_sigsegv (void)
1708 return sigaction (SIGSEGV, &sa, NULL) < 0 ? 0 : 1; 1708 return sigaction (SIGSEGV, &sa, NULL) < 0 ? 0 : 1;
1709} 1709}
1710 1710
1711#else /* not HAVE_STACK_OVERFLOW_HANDLING */ 1711#else /* not HAVE_STACK_OVERFLOW_HANDLING or WINDOWSNT */
1712 1712
1713static bool 1713static bool
1714init_sigsegv (void) 1714init_sigsegv (void)
@@ -1716,7 +1716,7 @@ init_sigsegv (void)
1716 return 0; 1716 return 0;
1717} 1717}
1718 1718
1719#endif /* HAVE_STACK_OVERFLOW_HANDLING */ 1719#endif /* HAVE_STACK_OVERFLOW_HANDLING && !WINDOWSNT */
1720 1720
1721static void 1721static void
1722deliver_arith_signal (int sig) 1722deliver_arith_signal (int sig)