diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-18 08:31:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-18 08:31:02 +0000 |
commit | 1f67a3900fbd45482ed36ad3b148b321307c1576 (patch) | |
tree | 7d61b1b855149f8a357603065e85761cb7d43202 /enum.c | |
parent | 8ffb23c2e1f2f292c8ed85b51ffb85f4811e5a9e (diff) | |
download | bundler-1f67a3900fbd45482ed36ad3b148b321307c1576.tar.gz |
vm_eval.c: rb_lambda_call
* enum.c (enum_collect): make the block arity same as the given
block. [Bug #13391]
* internal.h (vm_ifunc): store arity instead of unused id.
* proc.c (rb_vm_block_min_max_arity): return ifunc arity.
* vm_eval.c (rb_lambda_call): call method with lambda block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -494,11 +494,13 @@ static VALUE enum_collect(VALUE obj) { VALUE ary; + int min_argc, max_argc; RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size); ary = rb_ary_new(); - rb_block_call(obj, id_each, 0, 0, collect_i, ary); + min_argc = rb_block_min_max_arity(&max_argc); + rb_lambda_call(obj, id_each, 0, 0, collect_i, min_argc, max_argc, ary); return ary; } |