aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index be872baa8c..d2b28a8f44 100644
--- a/eval.c
+++ b/eval.c
@@ -8090,6 +8090,14 @@ proc_invoke(proc, args, self, klass)
POP_ITER();
ruby_block = old_block;
ruby_wrapper = old_wrapper;
+ if (FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) {
+ struct RVarmap *vars;
+
+ for (vars = old_dvars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
+ }
+ }
ruby_dyna_vars = old_dvars;
if (proc_safe_level_p(proc)) ruby_safe_level = safe;
@@ -12136,6 +12144,7 @@ rb_callcc(self)
volatile rb_thread_t th_save;
struct tag *tag;
struct RVarmap *vars;
+ struct BLOCK *blk;
THREAD_ALLOC(th);
cont = Data_Wrap_Struct(rb_cCont, thread_mark, thread_free, th);
@@ -12146,11 +12155,10 @@ rb_callcc(self)
}
th->thread = curr_thread->thread;
- for (vars = th->dyna_vars; vars; vars = vars->next) {
+ for (vars = ruby_dyna_vars; vars; vars = vars->next) {
if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
FL_SET(vars, DVAR_DONT_RECYCLE);
}
-
th_save = th;
if (THREAD_SAVE_CONTEXT(th)) {
return th_save->result;