diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-23 08:24:54 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-23 08:24:54 +0000 |
commit | d480f6889ac7d2a04bf65cbc066a8dc82c603e03 (patch) | |
tree | c20f7d0544a5754228eafb28f984c736fea49df4 /vm_eval.c | |
parent | d30a1b1e2bf9fb8844b7615b7d33e4036975d7c9 (diff) | |
download | ruby-d480f6889ac7d2a04bf65cbc066a8dc82c603e03.tar.gz |
rb_catch_protect() accepts enum ruby_tag_type *.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 37 |
1 files changed, 17 insertions, 20 deletions
@@ -1958,28 +1958,9 @@ rb_catch(const char *tag, VALUE (*func)(), VALUE data) return rb_catch_obj(vtag, func, data); } -static VALUE vm_catch_protect(VALUE, rb_block_call_func *, VALUE, int *, rb_thread_t *volatile); - -VALUE -rb_catch_obj(VALUE t, VALUE (*func)(), VALUE data) -{ - int state; - rb_thread_t *th = GET_THREAD(); - VALUE val = vm_catch_protect(t, (rb_block_call_func *)func, data, &state, th); - if (state) - TH_JUMP_TAG(th, state); - return val; -} - -VALUE -rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, int *stateptr) -{ - return vm_catch_protect(t, func, data, stateptr, GET_THREAD()); -} - static VALUE vm_catch_protect(VALUE tag, rb_block_call_func *func, VALUE data, - int *stateptr, rb_thread_t *volatile th) + enum ruby_tag_type *stateptr, rb_thread_t *volatile th) { enum ruby_tag_type state; VALUE val = Qnil; /* OK */ @@ -2006,6 +1987,22 @@ vm_catch_protect(VALUE tag, rb_block_call_func *func, VALUE data, return val; } +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()); +} + +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) TH_JUMP_TAG(th, state); + return val; +} + static void local_var_list_init(struct local_var_list *vars) { |