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

A function accepts ec instead of th.

* vm.c (rb_vm_search_cf_from_ep): accept `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-10-26 10:49:33 +00:00
parent 5f4a08253b
commit a8735ed206
2 changed files with 5 additions and 5 deletions

6
vm.c
View file

@ -32,13 +32,13 @@ VM_EP_LEP(const VALUE *ep)
}
static inline const rb_control_frame_t *
rb_vm_search_cf_from_ep(const rb_thread_t * const th, const rb_control_frame_t *cfp, const VALUE * const ep)
rb_vm_search_cf_from_ep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE * const ep)
{
if (!ep) {
return NULL;
}
else {
const rb_control_frame_t * const eocfp = RUBY_VM_END_CONTROL_FRAME(th->ec); /* end of control frame pointer */
const rb_control_frame_t * const eocfp = RUBY_VM_END_CONTROL_FRAME(ec); /* end of control frame pointer */
while (cfp < eocfp) {
if (cfp->ep == ep) {
@ -1478,7 +1478,7 @@ vm_iter_break(rb_thread_t *th, VALUE val)
{
rb_control_frame_t *cfp = next_not_local_frame(th->ec->cfp);
const VALUE *ep = VM_CF_PREV_EP(cfp);
const rb_control_frame_t *target_cfp = rb_vm_search_cf_from_ep(th, cfp, ep);
const rb_control_frame_t *target_cfp = rb_vm_search_cf_from_ep(th->ec, cfp, ep);
#if 0 /* raise LocalJumpError */
if (!target_cfp) {

View file

@ -1105,7 +1105,7 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
else {
ep = VM_ENV_PREV_EP(ep);
base_iseq = base_iseq->body->parent_iseq;
escape_cfp = rb_vm_search_cf_from_ep(th, escape_cfp, ep);
escape_cfp = rb_vm_search_cf_from_ep(th->ec, escape_cfp, ep);
VM_ASSERT(escape_cfp->iseq == base_iseq);
}
}
@ -1157,7 +1157,7 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
ep = VM_ENV_PREV_EP(ep);
}
escape_cfp = rb_vm_search_cf_from_ep(th, reg_cfp, ep);
escape_cfp = rb_vm_search_cf_from_ep(th->ec, reg_cfp, ep);
}
else if (state == TAG_RETURN) {
const VALUE *current_ep = GET_EP();