mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rb_catch now free from ANYARGS
After 5e86b005c0
, I now think ANYARGS is
dangerous and should be extinct. This commit deletes ANYARGS from
rb_catch, and fixes some bugs revealed by that.
This commit is contained in:
parent
703783324c
commit
af5e256640
3 changed files with 7 additions and 7 deletions
|
@ -212,7 +212,7 @@ static void extract_user_token _((struct cparse_params *v,
|
||||||
VALUE block_args, VALUE *tok, VALUE *val));
|
VALUE block_args, VALUE *tok, VALUE *val));
|
||||||
static void shift _((struct cparse_params* v, long act, VALUE tok, VALUE val));
|
static void shift _((struct cparse_params* v, long act, VALUE tok, VALUE val));
|
||||||
static int reduce _((struct cparse_params* v, long act));
|
static int reduce _((struct cparse_params* v, long act));
|
||||||
static VALUE reduce0 _((VALUE block_args, VALUE data, VALUE self));
|
static rb_block_call_func reduce0;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
# define D_puts(msg) if (v->sys_debug) puts(msg)
|
# define D_puts(msg) if (v->sys_debug) puts(msg)
|
||||||
|
@ -708,7 +708,7 @@ reduce(struct cparse_params *v, long act)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
reduce0(VALUE val, VALUE data, VALUE self)
|
reduce0(RB_BLOCK_CALL_FUNC_ARGLIST(_, data))
|
||||||
{
|
{
|
||||||
struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
|
struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
|
||||||
VALUE reduce_to, reduce_len, method_id;
|
VALUE reduce_to, reduce_len, method_id;
|
||||||
|
|
|
@ -1969,8 +1969,8 @@ VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
|
||||||
VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
|
VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
|
||||||
VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
|
VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
|
||||||
VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
|
VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
|
||||||
VALUE rb_catch(const char*,VALUE(*)(ANYARGS),VALUE);
|
VALUE rb_catch(const char*,rb_block_call_func_t,VALUE);
|
||||||
VALUE rb_catch_obj(VALUE,VALUE(*)(ANYARGS),VALUE);
|
VALUE rb_catch_obj(VALUE,rb_block_call_func_t,VALUE);
|
||||||
NORETURN(void rb_throw(const char*,VALUE));
|
NORETURN(void rb_throw(const char*,VALUE));
|
||||||
NORETURN(void rb_throw_obj(VALUE,VALUE));
|
NORETURN(void rb_throw_obj(VALUE,VALUE));
|
||||||
|
|
||||||
|
|
|
@ -1921,7 +1921,7 @@ rb_throw(const char *tag, VALUE val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
catch_i(VALUE tag, VALUE data)
|
catch_i(RB_BLOCK_CALL_FUNC_ARGLIST(tag, _))
|
||||||
{
|
{
|
||||||
return rb_yield_0(1, &tag);
|
return rb_yield_0(1, &tag);
|
||||||
}
|
}
|
||||||
|
@ -1985,7 +1985,7 @@ rb_f_catch(int argc, VALUE *argv, VALUE self)
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_catch(const char *tag, VALUE (*func)(), VALUE data)
|
rb_catch(const char *tag, rb_block_call_func_t func, VALUE data)
|
||||||
{
|
{
|
||||||
VALUE vtag = tag ? rb_sym_intern_ascii_cstr(tag) : rb_obj_alloc(rb_cObject);
|
VALUE vtag = tag ? rb_sym_intern_ascii_cstr(tag) : rb_obj_alloc(rb_cObject);
|
||||||
return rb_catch_obj(vtag, func, data);
|
return rb_catch_obj(vtag, func, data);
|
||||||
|
@ -2027,7 +2027,7 @@ rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_ty
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_catch_obj(VALUE t, VALUE (*func)(), VALUE data)
|
rb_catch_obj(VALUE t, rb_block_call_func_t func, VALUE data)
|
||||||
{
|
{
|
||||||
enum ruby_tag_type state;
|
enum ruby_tag_type state;
|
||||||
rb_execution_context_t *ec = GET_EC();
|
rb_execution_context_t *ec = GET_EC();
|
||||||
|
|
Loading…
Reference in a new issue