Project

General

Profile

Bug #9739 ยป 0001-Handle-machine-stack-overflow-on-mingw.patch

h.shirosaki (Hiroshi Shirosaki), 05/15/2014 03:11 AM

View differences:

eval_intern.h
EXCEPTION_CONTINUE_SEARCH) { \
/* never reaches here */ \
}
#elif defined(__MINGW32__)
LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
do { \
PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler);
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
RemoveVectoredExceptionHandler(_handler); \
} while (0);
#else
#define SAVE_ROOT_JMPBUF_BEFORE_STMT
#define SAVE_ROOT_JMPBUF_AFTER_STMT
thread_win32.c
return rb_thread_raised_p(th, RAISED_STACKOVERFLOW);
}
#if defined(__MINGW32__)
LONG WINAPI
rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *exception)
{
if (exception->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) {
rb_thread_raised_set(GET_THREAD(), RAISED_STACKOVERFLOW);
raise(SIGSEGV);
}
return EXCEPTION_CONTINUE_SEARCH;
}
#endif
#ifdef RUBY_ALLOCA_CHKSTK
void
ruby_alloca_chkstk(size_t len, void *sp)
    (1-1/1)