summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-27 05:59:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-27 05:59:03 +0000
commitceec42bf8c4e350d02d11b84adf9b8ebf7b4af47 (patch)
tree6f9e1b9a22f7b1f58a4d23e6e44b3c3cff16c6b0 /eval.c
parent8369164408f2f9aa2984257f428f957876a84ced (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/eval.c b/eval.c
index 5728648..c7e88ca 100644
--- a/eval.c
+++ b/eval.c
@@ -1982,7 +1982,7 @@ rb_eval(self, n)
/* nodes for speed-up(default match) */
case NODE_MATCH:
- result = rb_reg_match2(node->nd_head->nd_lit);
+ result = rb_reg_match2(node->nd_lit);
break;
/* nodes for speed-up(literal match) */
@@ -3558,17 +3558,18 @@ rb_yield_0(val, self, klass, acheck)
pop_state:
POP_ITER();
POP_CLASS();
- if ((block->flags & BLOCK_D_SCOPE) &&
+ if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) &&
!FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) {
- struct RVarmap *vars = ruby_dyna_vars;
+ struct RVarmap *vars, *tmp;
- while (vars && vars->id != 0) {
- struct RVarmap *tmp = vars->next;
- rb_gc_force_recycle((VALUE)vars);
- vars = tmp;
- }
- if (ruby_dyna_vars && ruby_dyna_vars->id == 0) {
+ if (ruby_dyna_vars->id == 0) {
+ vars = ruby_dyna_vars->next;
rb_gc_force_recycle((VALUE)ruby_dyna_vars);
+ while (vars && vars->id != 0) {
+ tmp = vars->next;
+ rb_gc_force_recycle((VALUE)vars);
+ vars = tmp;
+ }
}
}
POP_VARS();