From 3600b5e6f749559d7036792032852a1fbb3a1193 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 21 Dec 2014 02:35:48 +0000 Subject: thread.c: no allocation during GC * thread.c (ruby_thread_stack_overflow): jump without setting up the exception not to allocate new objects, during GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/thread.c b/thread.c index eb9b27f3d6..25e36f25fb 100644 --- a/thread.c +++ b/thread.c @@ -2080,11 +2080,12 @@ ruby_thread_stack_overflow(rb_thread_t *th) { th->raised_flag = 0; #ifdef USE_SIGALTSTACK - rb_exc_raise(sysstack_error); -#else + if (!rb_during_gc()) { + rb_exc_raise(sysstack_error); + } +#endif th->errinfo = sysstack_error; TH_JUMP_TAG(th, TAG_RAISE); -#endif } int -- cgit v1.2.3