From ebcde8399fca12b0dd79153eb790af1a816746b8 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 24 Sep 2004 16:58:51 +0000 Subject: * struct.c (rb_struct_s_members): wrong call of struct_members. [ruby-dev:24333] * eval.c (proc_invoke): propagate DVAR_DONT_RECYCLE on termination to avoid double call to rb_gc_force_recycle(). [ruby-dev:24311] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index be872baa8..d2b28a8f4 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; -- cgit