summaryrefslogtreecommitdiffstats
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
commit6202f851c777a8327491ddca8f2df39b20ff9b5a (patch)
tree6f9e1b9a22f7b1f58a4d23e6e44b3c3cff16c6b0 /eval.c
parent317996699cf5ce975701fa3becdb03dc1aaf0fb7 (diff)
downloadruby-6202f851c777a8327491ddca8f2df39b20ff9b5a.tar.gz
ruby-6202f851c777a8327491ddca8f2df39b20ff9b5a.tar.xz
ruby-6202f851c777a8327491ddca8f2df39b20ff9b5a.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/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 57286486e..c7e88cab7 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();