summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 02:35:48 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 02:35:48 (GMT)
commit3600b5e6f749559d7036792032852a1fbb3a1193 (patch)
tree71ed99e35c966fd2b529b8c41ab62f76e3682a16 /thread.c
parentd33830308f79150f362f42e32d5a653c094e745a (diff)
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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/thread.c b/thread.c
index eb9b27f..25e36f2 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