summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 15:03:33 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 15:03:33 +0000
commit9ffc0d19b73be82f77210ce8fb8d3eb10646fe82 (patch)
tree435c930d0ce889c5c9fc680a119f3ad67806404a /vm_eval.c
parenta034fc81a9ef6e24f891d8af52fbb1b0a232f1ac (diff)
* 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
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 9834702..fe52b9c 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;
}