From 1df5ebf450b13427466c4e31fd3970c8430b6ac7 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 21 Nov 2013 06:33:41 +0000 Subject: * eval_intern.h (SAVE_ROOT_JMPBUF): workaround for the failure of test/ruby/test_exception.rb on Windows. wrap by __try and __exception statements on mswin to raise SIGSEGV when EXCEPTION_STACK_OVERFLOW is occurred, because MSVCRT doesn't handle the exception. however, (1) mingw-gcc doesn't support __try and __exception statements, and (2) we cannot retry SystemStackError after this change yet (maybe crashed) because SEH and longjmp() are too uncongenial. * signal.c (check_stack_overflow, CHECK_STACK_OVERFLOW): now defined on Windows, too. * thread_win32.c (ruby_stack_overflowed_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- signal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'signal.c') diff --git a/signal.c b/signal.c index 75b4b9bf09..b07a99db15 100644 --- a/signal.c +++ b/signal.c @@ -627,7 +627,7 @@ rb_get_next_signal(void) } -#ifdef USE_SIGALTSTACK +#if defined(USE_SIGALTSTACK) || defined(_WIN32) static void check_stack_overflow(const void *addr) { @@ -638,7 +638,11 @@ check_stack_overflow(const void *addr) ruby_thread_stack_overflow(th); } } +#ifdef _WIN32 +#define CHECK_STACK_OVERFLOW() check_stack_overflow(0) +#else #define CHECK_STACK_OVERFLOW() check_stack_overflow(info->si_addr) +#endif #else #define CHECK_STACK_OVERFLOW() (void)0 #endif -- cgit v1.2.3