summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
commit2252d4ce028b38bb46310b215b2c98afbf224d55 (patch)
tree4bc848c3b8cdde1032611e27217cec98134055e2 /eval.c
parent6001314def338002ae1dc50bcf120805bee78a44 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/eval.c b/eval.c
index f367322fd7..be0303e0a4 100644
--- a/eval.c
+++ b/eval.c
@@ -798,13 +798,12 @@ static rb_thread_t curr_thread = 0;
if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\
if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\
} \
- else { \
- if (ruby_scope->flag == SCOPE_ALLOCA) {\
- ruby_scope->local_vars = 0; \
- ruby_scope->local_tbl = 0; \
- if (ruby_scope != top_scope)\
- rb_gc_force_recycle((VALUE)ruby_scope);\
- } \
+ if (!(ruby_scope->flag & SCOPE_MALLOC)) {\
+ ruby_scope->local_vars = 0; \
+ ruby_scope->local_tbl = 0; \
+ if (ruby_scope != top_scope) { \
+ rb_gc_force_recycle((VALUE)ruby_scope);\
+ } \
} \
ruby_scope->flag |= SCOPE_NOSTACK; \
ruby_scope = _old; \
@@ -3451,6 +3450,7 @@ rb_yield_0(val, self, klass, acheck)
switch (state) {
case TAG_REDO:
state = 0;
+ CHECK_INTS;
goto redo;
case TAG_NEXT:
state = 0;
@@ -5685,17 +5685,17 @@ scope_dup(scope)
ID *tbl;
VALUE *vars;
- 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;
+ 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;
+ }
}
static void