From 9ce253a2cfc26cc7a0d2cfeeaf15d6216d522077 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 24 Apr 1998 09:33:30 +0000 Subject: gtk/nested local variables git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 7c3d8d07d6..2ff7932a60 100644 --- a/eval.c +++ b/eval.c @@ -452,19 +452,17 @@ new_dvar(id, value) { NEWOBJ(vars, struct RVarmap); OBJSETUP(vars, 0, T_VARMAP); - vars->id = id; vars->val = value; if (id == 0) { + vars->id = (ID)value; vars->next = the_dyna_vars; + the_dyna_vars = vars; } else if (the_dyna_vars) { + vars->id = id; vars->next = the_dyna_vars->next; the_dyna_vars->next = vars; } - else { /* complie time dyna_var check */ - vars->next = the_dyna_vars; - the_dyna_vars = vars; - } return vars; } @@ -1702,7 +1700,6 @@ rb_eval(self, node) { iter_retry: PUSH_BLOCK(node->nd_var, node->nd_body); - _block.d_vars = new_dvar(0,0); PUSH_TAG(PROT_FUNC); state = EXEC_TAG(); @@ -2804,7 +2801,8 @@ rb_yield_0(val, self) old_scope = the_scope; the_scope = block->scope; the_block = block->prev; - the_dyna_vars = block->d_vars; + the_dyna_vars = new_dvar(0, 0); + the_dyna_vars->next = block->d_vars; the_class = block->klass; if (!self) self = block->self; node = block->body; -- cgit v1.2.3