aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--enum.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d4ae75bc50..08faa2496e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Fri Feb 17 13:24:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 17 15:20:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (enum_each_slice): arrays to be yielded can be newly
+ created in the block.
* enum.c: move work variables to objects not to let called blocks
access stack area out of scope. [Bug #5801]
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;