summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/thread.c b/thread.c
index eb9b27f3d64..25e36f25fbd 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