array.c: avoid (VALUE)--
This args[1]-- overflows when it is zero. Should do that only when we can say it is nonzero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1a5b274ee2
commit
6bdca5d85e
3
array.c
3
array.c
@ -3598,7 +3598,8 @@ static VALUE
|
|||||||
take_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, cbarg))
|
take_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, cbarg))
|
||||||
{
|
{
|
||||||
VALUE *args = (VALUE *)cbarg;
|
VALUE *args = (VALUE *)cbarg;
|
||||||
if (args[1]-- == 0) rb_iter_break();
|
if (args[1] == 0) rb_iter_break();
|
||||||
|
else args[1]--;
|
||||||
if (argc > 1) val = rb_ary_new4(argc, argv);
|
if (argc > 1) val = rb_ary_new4(argc, argv);
|
||||||
rb_ary_push(args[0], val);
|
rb_ary_push(args[0], val);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user