mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added more NORETURN declarations
This commit is contained in:
parent
a1e1fdca09
commit
5d430c1b34
11 changed files with 37 additions and 11 deletions
|
@ -10856,11 +10856,13 @@ ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj)
|
||||||
rb_raise(rb_eNotImpError, "ibf_dump_object_unsupported: %s", buff);
|
rb_raise(rb_eNotImpError, "ibf_dump_object_unsupported: %s", buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset));
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
|
ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eArgError, "unsupported");
|
rb_raise(rb_eArgError, "unsupported");
|
||||||
return Qnil;
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
4
cont.c
4
cont.c
|
@ -1610,6 +1610,8 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE rb_cont_call(int argc, VALUE *argv, VALUE contval));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* cont.call(args, ...)
|
* cont.call(args, ...)
|
||||||
|
@ -1648,7 +1650,7 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
|
||||||
cont->value = make_passing_arg(argc, argv);
|
cont->value = make_passing_arg(argc, argv);
|
||||||
|
|
||||||
cont_restore_0(cont, &contval);
|
cont_restore_0(cont, &contval);
|
||||||
return Qnil; /* unreachable */
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********/
|
/*********/
|
||||||
|
|
4
dir.c
4
dir.c
|
@ -1966,13 +1966,15 @@ rb_glob_warning(const char *path, VALUE a, const void *enc, int error)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
NORETURN(static VALUE glob_func_error(VALUE val));
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
glob_func_error(VALUE val)
|
glob_func_error(VALUE val)
|
||||||
{
|
{
|
||||||
struct glob_error_args *arg = (struct glob_error_args *)val;
|
struct glob_error_args *arg = (struct glob_error_args *)val;
|
||||||
VALUE path = rb_enc_str_new_cstr(arg->path, arg->enc);
|
VALUE path = rb_enc_str_new_cstr(arg->path, arg->enc);
|
||||||
rb_syserr_fail_str(arg->error, path);
|
rb_syserr_fail_str(arg->error, path);
|
||||||
return Qnil;
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -1302,12 +1302,13 @@ enc_compatible_p(VALUE klass, VALUE str1, VALUE str2)
|
||||||
return rb_enc_from_encoding(enc);
|
return rb_enc_from_encoding(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE enc_s_alloc(VALUE klass));
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
static VALUE
|
static VALUE
|
||||||
enc_s_alloc(VALUE klass)
|
enc_s_alloc(VALUE klass)
|
||||||
{
|
{
|
||||||
rb_undefined_alloc(klass);
|
rb_undefined_alloc(klass);
|
||||||
return Qnil;
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
|
|
1
enum.c
1
enum.c
|
@ -1021,6 +1021,7 @@ enum_tally(VALUE obj)
|
||||||
return enum_hashify(obj, 0, 0, tally_i);
|
return enum_hashify(obj, 0, 0, tally_i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params)));
|
||||||
static VALUE
|
static VALUE
|
||||||
first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
|
first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
|
||||||
{
|
{
|
||||||
|
|
10
enumerator.c
10
enumerator.c
|
@ -2676,7 +2676,8 @@ lazy_with_index_proc(VALUE proc_entry, struct MEMO* result, VALUE memos, long me
|
||||||
if (entry->proc) {
|
if (entry->proc) {
|
||||||
rb_proc_call_with_block(entry->proc, 2, argv, Qnil);
|
rb_proc_call_with_block(entry->proc, 2, argv, Qnil);
|
||||||
LAZY_MEMO_RESET_PACKED(result);
|
LAZY_MEMO_RESET_PACKED(result);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
LAZY_MEMO_SET_VALUE(result, rb_ary_new_from_values(2, argv));
|
LAZY_MEMO_SET_VALUE(result, rb_ary_new_from_values(2, argv));
|
||||||
LAZY_MEMO_SET_PACKED(result);
|
LAZY_MEMO_SET_PACKED(result);
|
||||||
}
|
}
|
||||||
|
@ -2931,6 +2932,8 @@ producer_each_stop(VALUE dummy, VALUE exc)
|
||||||
return rb_attr_get(exc, id_result);
|
return rb_attr_get(exc, id_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE producer_each_i(VALUE obj));
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
producer_each_i(VALUE obj)
|
producer_each_i(VALUE obj)
|
||||||
{
|
{
|
||||||
|
@ -2943,7 +2946,8 @@ producer_each_i(VALUE obj)
|
||||||
|
|
||||||
if (init == Qundef) {
|
if (init == Qundef) {
|
||||||
curr = Qnil;
|
curr = Qnil;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
rb_yield(init);
|
rb_yield(init);
|
||||||
curr = init;
|
curr = init;
|
||||||
}
|
}
|
||||||
|
@ -2953,7 +2957,7 @@ producer_each_i(VALUE obj)
|
||||||
rb_yield(curr);
|
rb_yield(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Qnil;
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
|
|
2
gc.c
2
gc.c
|
@ -968,6 +968,8 @@ void rb_gcdebug_print_obj_condition(VALUE obj);
|
||||||
|
|
||||||
static VALUE define_final0(VALUE obj, VALUE block);
|
static VALUE define_final0(VALUE obj, VALUE block);
|
||||||
|
|
||||||
|
NORETURN(static void *gc_vraise(void *ptr));
|
||||||
|
NORETURN(static void gc_raise(VALUE exc, const char *fmt, ...));
|
||||||
NORETURN(static void negative_size_allocation_error(const char *));
|
NORETURN(static void negative_size_allocation_error(const char *));
|
||||||
|
|
||||||
static void init_mark_stack(mark_stack_t *stack);
|
static void init_mark_stack(mark_stack_t *stack);
|
||||||
|
|
3
hash.c
3
hash.c
|
@ -6328,6 +6328,7 @@ env_reject(VALUE _)
|
||||||
return rb_hash_delete_if(env_to_hash());
|
return rb_hash_delete_if(env_to_hash());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE env_freeze(VALUE self));
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* ENV.freeze
|
* ENV.freeze
|
||||||
|
@ -6339,7 +6340,7 @@ static VALUE
|
||||||
env_freeze(VALUE self)
|
env_freeze(VALUE self)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eTypeError, "cannot freeze ENV");
|
rb_raise(rb_eTypeError, "cannot freeze ENV");
|
||||||
return self; /* Not reached */
|
UNREACHABLE_RETURN(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -479,6 +479,8 @@ rb_num_coerce_relop(VALUE x, VALUE y, ID func)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE num_sadded(VALUE x, VALUE name));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* :nodoc:
|
* :nodoc:
|
||||||
*
|
*
|
||||||
|
|
14
process.c
14
process.c
|
@ -2931,6 +2931,8 @@ rb_f_exec(int argc, const VALUE *argv)
|
||||||
UNREACHABLE_RETURN(Qnil);
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE f_exec(int c, const VALUE *a, VALUE _));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* exec([env,] command... [,options])
|
* exec([env,] command... [,options])
|
||||||
|
@ -3007,7 +3009,8 @@ rb_f_exec(int argc, const VALUE *argv)
|
||||||
static VALUE
|
static VALUE
|
||||||
f_exec(int c, const VALUE *a, VALUE _)
|
f_exec(int c, const VALUE *a, VALUE _)
|
||||||
{
|
{
|
||||||
return rb_f_exec(c, a);
|
rb_f_exec(c, a);
|
||||||
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)
|
#define ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)
|
||||||
|
@ -4175,6 +4178,7 @@ exit_status_code(VALUE status)
|
||||||
return istatus;
|
return istatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj));
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* Process.exit!(status=false)
|
* Process.exit!(status=false)
|
||||||
|
@ -4231,6 +4235,7 @@ rb_f_exit(int argc, const VALUE *argv)
|
||||||
UNREACHABLE_RETURN(Qnil);
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE f_exit(int c, const VALUE *a, VALUE _));
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* exit(status=true)
|
* exit(status=true)
|
||||||
|
@ -4275,7 +4280,8 @@ rb_f_exit(int argc, const VALUE *argv)
|
||||||
static VALUE
|
static VALUE
|
||||||
f_exit(int c, const VALUE *a, VALUE _)
|
f_exit(int c, const VALUE *a, VALUE _)
|
||||||
{
|
{
|
||||||
return rb_f_exit(c, a);
|
rb_f_exit(c, a);
|
||||||
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4314,10 +4320,12 @@ rb_f_abort(int argc, const VALUE *argv)
|
||||||
UNREACHABLE_RETURN(Qnil);
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE f_abort(int c, const VALUE *a, VALUE _));
|
||||||
static VALUE
|
static VALUE
|
||||||
f_abort(int c, const VALUE *a, VALUE _)
|
f_abort(int c, const VALUE *a, VALUE _)
|
||||||
{
|
{
|
||||||
return rb_f_abort(c, a);
|
rb_f_abort(c, a);
|
||||||
|
UNREACHABLE_RETURN(Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1437,6 +1437,7 @@ rb_condvar_broadcast(VALUE self)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NORETURN(static VALUE undumpable(VALUE obj));
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
static VALUE
|
static VALUE
|
||||||
undumpable(VALUE obj)
|
undumpable(VALUE obj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue