From 5d430c1b34b6162d4cfbd472fae09e6ea282f3a3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 11 May 2020 00:24:14 +0900 Subject: Added more NORETURN declarations --- enumerator.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'enumerator.c') 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: */ -- cgit v1.2.3