summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--eval.c24
-rw-r--r--gc.c2
3 files changed, 15 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index d867fe2..59a674a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/eval.c b/eval.c
index f260bae..f367322 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
diff --git a/gc.c b/gc.c
index 93802f4..fb221f2 100644
--- a/gc.c
+++ b/gc.c
@@ -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];