From 767d70841a998c16a7487f9b286a9a944f69e7b7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 26 Oct 2010 09:09:45 +0000 Subject: * Makefile.in (ASFLAGS): needs INCFLAGS. * configure.in (rb_cv_dynamic_alloca): check if extra source for dynamic size alloca. * missing/x86_64-chkstk.s (___chkstk): necessary for alloca of amd64-mingw32msvc-gcc on Ubutu. * thread_win32.c (ruby_alloca_chkstk): check stack overflow git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_win32.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'thread_win32.c') diff --git a/thread_win32.c b/thread_win32.c index 46764f0..d9f006a 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -597,4 +597,17 @@ native_reset_timer_thread(void) } } +#ifdef RUBY_ALLOCA_CHKSTK +void +ruby_alloca_chkstk(size_t len, void *sp) +{ + if (ruby_stack_length(NULL) * sizeof(VALUE) >= len) { + rb_thread_t *th = GET_THREAD(); + if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW)) { + rb_thread_raised_set(th, RAISED_STACKOVERFLOW); + rb_exc_raise(sysstack_error); + } + } +} +#endif #endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */ -- cgit v1.1