From be37634ffbc46ce3d839b94989be644720fed517 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 31 Aug 2000 09:08:14 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index f260bae51..f367322fd 100644 --- a/eval.c +++ b/eval.c @@ -805,10 +805,8 @@ static rb_thread_t curr_thread = 0; if (ruby_scope != top_scope)\ rb_gc_force_recycle((VALUE)ruby_scope);\ } \ - else { \ - ruby_scope->flag |= SCOPE_NOSTACK;\ - } \ } \ + ruby_scope->flag |= SCOPE_NOSTACK; \ ruby_scope = _old; \ scope_vmode = _vmode; \ } @@ -5687,17 +5685,17 @@ scope_dup(scope) ID *tbl; VALUE *vars; - scope->flag |= SCOPE_DONT_RECYCLE; - if (scope->flag & SCOPE_MALLOC) return; - - if (scope->local_tbl) { - tbl = scope->local_tbl; - vars = ALLOC_N(VALUE, tbl[0]+1); - *vars++ = scope->local_vars[-1]; - MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); - scope->local_vars = vars; - scope->flag = SCOPE_MALLOC; + if (!(scope->flag & SCOPE_MALLOC)) { + if (scope->local_tbl) { + tbl = scope->local_tbl; + vars = ALLOC_N(VALUE, tbl[0]+1); + *vars++ = scope->local_vars[-1]; + MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); + scope->local_vars = vars; + scope->flag = SCOPE_MALLOC; + } } + scope->flag |= SCOPE_DONT_RECYCLE; } static void -- cgit