Skip to content

Commit

Permalink
* enum.c (enum_each_slice): arrays to be yielded can be newly
Browse files Browse the repository at this point in the history
  created in the block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 17, 2012
1 parent 41e331c commit 5362e7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 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]
Expand Down
1 change: 1 addition & 0 deletions enum.c
Expand Up @@ -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;
Expand Down

0 comments on commit 5362e7f

Please sign in to comment.