diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-05-11 00:24:14 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-05-11 00:40:14 +0900 |
commit | 5d430c1b34b6162d4cfbd472fae09e6ea282f3a3 (patch) | |
tree | 23b5b2a1e472c04100acabb934cff1a6639ada5b /enumerator.c | |
parent | a1e1fdca091bdd20ccfd69b682e8f1f6f51fa4f3 (diff) |
Added more NORETURN declarations
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/enumerator.c b/enumerator.c index cc0cce8fae..c2fde9a9bc 100644 --- a/enumerator.c +++ b/enumerator.c @@ -2676,7 +2676,8 @@ lazy_with_index_proc(VALUE proc_entry, struct MEMO* result, VALUE memos, long me if (entry->proc) { rb_proc_call_with_block(entry->proc, 2, argv, Qnil); LAZY_MEMO_RESET_PACKED(result); - } else { + } + else { LAZY_MEMO_SET_VALUE(result, rb_ary_new_from_values(2, argv)); LAZY_MEMO_SET_PACKED(result); } @@ -2931,6 +2932,8 @@ producer_each_stop(VALUE dummy, VALUE exc) return rb_attr_get(exc, id_result); } +NORETURN(static VALUE producer_each_i(VALUE obj)); + static VALUE producer_each_i(VALUE obj) { @@ -2943,7 +2946,8 @@ producer_each_i(VALUE obj) if (init == Qundef) { curr = Qnil; - } else { + } + else { rb_yield(init); curr = init; } @@ -2953,7 +2957,7 @@ producer_each_i(VALUE obj) rb_yield(curr); } - return Qnil; + UNREACHABLE_RETURN(Qnil); } /* :nodoc: */ |