summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 3d8bb69a45b..f7bc8d2c1f5 100644
--- a/eval.c
+++ b/eval.c
@@ -7982,6 +7982,7 @@ rb_thread_save_context(th)
th->stk_pos = (rb_gc_stack_start<pos)?rb_gc_stack_start
:rb_gc_stack_start - len;
if (len > th->stk_max) {
+ rb_gc();
REALLOC_N(th->stk_ptr, VALUE, len);
th->stk_max = len;
}
@@ -7998,6 +7999,7 @@ rb_thread_save_context(th)
th->wrapper = ruby_wrapper;
th->cref = ruby_cref;
th->dyna_vars = ruby_dyna_vars;
+ FL_SET(ruby_dyna_vars, DVAR_DONT_RECYCLE);
th->block = ruby_block;
th->flags &= THREAD_FLAGS_MASK;
th->flags |= (rb_trap_immediate<<8) | scope_vmode;