diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | eval.c | 24 | ||||
-rw-r--r-- | gc.c | 2 |
3 files changed, 15 insertions, 15 deletions
@@ -1,9 +1,11 @@ -Thu Aug 31 17:06:09 2000 Yukihiro Matsumoto <matz@ruby-lang.org> +Thu Aug 31 18:07:14 2000 Yukihiro Matsumoto <matz@ruby-lang.org> * stable version 1.6.0 released. Thu Aug 31 14:28:39 2000 Yukihiro Matsumoto <matz@ruby-lang.org> + * gc.c (rb_gc_mark): T_SCOPE condition must be more precise. + * eval.c (scope_dup): should not make all duped scope orphan. Thu Aug 31 10:11:47 2000 Yukihiro Matsumoto <matz@ruby-lang.org> @@ -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 @@ -621,7 +621,7 @@ rb_gc_mark(ptr) case T_SCOPE: if (obj->as.scope.local_vars && - obj->as.scope.flag != SCOPE_ALLOCA) { + (obj->as.scope.flag & SCOPE_MALLOC) != 0) { int n = obj->as.scope.local_tbl[0]+1; VALUE *vars = &obj->as.scope.local_vars[-1]; |