summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-05-29 14:04:25 +0900
committernagachika <nagachika@ruby-lang.org>2021-05-29 14:04:25 +0900
commit20bf397f7cebd8156d76941dd54659cf9b8c8fe7 (patch)
tree458345732362cd95fefd2b12ce0d101f17fab6b1 /enumerator.c
parent9d63a8dd0beefa49796eb86ab688c2eb0cd89a20 (diff)
merge revision(s) fd8991f797c145615820b4c76e6b7ac5a71339ea: [Backport #17889]
Fix lazy enumerator with index size Fixes [Bug #17889] --- enumerator.c | 7 ++++++- test/ruby/test_lazy_enumerator.rb | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-)
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index b4a7cb588e..90d2ec433c 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -2678,8 +2678,13 @@ lazy_with_index_proc(VALUE proc_entry, struct MEMO* result, VALUE memos, long me
return result;
}
+static VALUE
+lazy_with_index_size(VALUE proc, VALUE receiver) {
+ return receiver;
+}
+
static const lazyenum_funcs lazy_with_index_funcs = {
- lazy_with_index_proc, 0,
+ lazy_with_index_proc, lazy_with_index_size,
};
/*