1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_eval): set current node after arguments evaluation.

[ruby-dev:21632]

* eval.c (rb_yield_0): set current node and keep it at local jump.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-10-20 14:55:50 +00:00
parent 28f2a1da54
commit d6153337f6
2 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,10 @@
Mon Oct 20 23:55:47 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_eval): set current node after arguments evaluation.
[ruby-dev:21632]
* eval.c (rb_yield_0): set current node and keep it at local jump.
Mon Oct 20 22:01:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_thread_cleanup): keep thread group for main thread.

14
eval.c
View file

@ -2809,6 +2809,7 @@ rb_eval(self, n)
case NODE_YIELD:
if (node->nd_head) {
result = rb_eval(self, node->nd_head);
ruby_current_node = node;
}
else {
result = Qundef; /* no arg */
@ -2993,6 +2994,7 @@ rb_eval(self, n)
SETUP_ARGS(node->nd_args);
END_CALLARGS;
ruby_current_node = node;
SET_CURRENT_SOURCE();
rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,scope);
result = argv[argc-1];
@ -3010,6 +3012,7 @@ rb_eval(self, n)
SETUP_ARGS(node->nd_args);
END_CALLARGS;
ruby_current_node = node;
SET_CURRENT_SOURCE();
result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0);
}
@ -3024,6 +3027,7 @@ rb_eval(self, n)
SETUP_ARGS(node->nd_args);
END_CALLARGS;
ruby_current_node = node;
SET_CURRENT_SOURCE();
result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1);
}
@ -3058,6 +3062,7 @@ rb_eval(self, n)
BEGIN_CALLARGS;
SETUP_ARGS(node->nd_args);
END_CALLARGS;
ruby_current_node = node;
}
SET_CURRENT_SOURCE();
@ -4171,11 +4176,10 @@ rb_yield_0(val, self, klass, flags, avalue)
val = Qnil;
multi_values:
{
NODE *curr = ruby_current_node;
ruby_current_node = block->var;
rb_warn("multiple values for a block parameter (%d for 1)\n\tfrom %s:%d",
len, curr->nd_file, nd_line(curr));
ruby_current_node = curr;
len, cnode->nd_file, nd_line(cnode));
ruby_current_node = cnode;
}
}
assign(self, block->var, val, flags&YIELD_PROC_CALL);
@ -4188,6 +4192,7 @@ rb_yield_0(val, self, klass, flags, avalue)
state = 0;
goto pop_state;
}
ruby_current_node = node;
PUSH_ITER(block->iter);
PUSH_TAG(PROT_NONE);
@ -4253,8 +4258,8 @@ rb_yield_0(val, self, klass, flags, avalue)
scope_dup(old_scope);
ruby_scope = old_scope;
scope_vmode = old_vmode;
ruby_current_node = cnode;
if (state) JUMP_TAG(state);
ruby_current_node = cnode;
return result;
}
@ -7054,7 +7059,6 @@ proc_invoke(proc, args, self, klass)
PUSH_ITER(ITER_CUR);
ruby_frame->iter = ITER_CUR;
ruby_current_node = data->body;
PUSH_TAG((pcall || orphan) ? PROT_PCALL : PROT_CALL);
state = EXEC_TAG();
if (state == 0) {