summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-17 06:20:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-17 06:20:56 +0000
commit5362e7fcddf70d16fc4261383f99175c90881353 (patch)
treeb845f2187faa23394d4df8e3e2e9b1b3a2753a3b /enum.c
parent41e331cc361a1ba89a5663d2cec7505f5bc82552 (diff)
* enum.c (enum_each_slice): arrays to be yielded can be newly
created in the block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 988615b76a..3a85c503f6 100644
--- a/enum.c
+++ b/enum.c
@@ -1828,6 +1828,7 @@ enum_each_slice(VALUE obj, VALUE n)
ary = rb_ary_new2(size);
memo = NEW_MEMO(ary, 0, size);
rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)memo);
+ ary = memo->u1.value;
if (RARRAY_LEN(ary) > 0) rb_yield(ary);
return Qnil;