From 9ffc0d19b73be82f77210ce8fb8d3eb10646fe82 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 29 Oct 2017 15:03:33 +0000 Subject: * vm_eval.c (vm_catch_protect): accepts `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 98347020ea..fe52b9c04b 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1984,13 +1984,13 @@ rb_catch(const char *tag, VALUE (*func)(), VALUE data) static VALUE vm_catch_protect(VALUE tag, rb_block_call_func *func, VALUE data, - enum ruby_tag_type *stateptr, rb_thread_t *volatile th) + enum ruby_tag_type *stateptr, rb_execution_context_t *volatile ec) { enum ruby_tag_type state; VALUE val = Qnil; /* OK */ - rb_control_frame_t *volatile saved_cfp = th->ec->cfp; + rb_control_frame_t *volatile saved_cfp = ec->cfp; - EC_PUSH_TAG(th->ec); + EC_PUSH_TAG(ec); _tag.tag = tag; @@ -1998,10 +1998,10 @@ vm_catch_protect(VALUE tag, rb_block_call_func *func, VALUE data, /* call with argc=1, argv = [tag], block = Qnil to insure compatibility */ val = (*func)(tag, data, 1, (const VALUE *)&tag, Qnil); } - else if (state == TAG_THROW && THROW_DATA_VAL((struct vm_throw_data *)th->ec->errinfo) == tag) { - rb_vm_rewind_cfp(th->ec, saved_cfp); - val = th->ec->tag->retval; - th->ec->errinfo = Qnil; + else if (state == TAG_THROW && THROW_DATA_VAL((struct vm_throw_data *)ec->errinfo) == tag) { + rb_vm_rewind_cfp(ec, saved_cfp); + val = ec->tag->retval; + ec->errinfo = Qnil; state = 0; } EC_POP_TAG(); @@ -2014,16 +2014,16 @@ vm_catch_protect(VALUE tag, rb_block_call_func *func, VALUE data, VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr) { - return vm_catch_protect(t, func, data, stateptr, GET_THREAD()); + return vm_catch_protect(t, func, data, stateptr, GET_EC()); } VALUE rb_catch_obj(VALUE t, VALUE (*func)(), VALUE data) { enum ruby_tag_type state; - rb_thread_t *th = GET_THREAD(); - VALUE val = vm_catch_protect(t, (rb_block_call_func *)func, data, &state, th); - if (state) EC_JUMP_TAG(th->ec, state); + rb_execution_context_t *ec = GET_EC(); + VALUE val = vm_catch_protect(t, (rb_block_call_func *)func, data, &state, ec); + if (state) EC_JUMP_TAG(ec, state); return val; } -- cgit v1.2.3