summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-18 14:03:36 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-18 14:03:36 +0000
commit2c07970dd7b4f1388c41cfc66bb52da7cbee393c (patch)
tree51424391b36b08ca22f99bd00482fa72e1f097b0 /vm_args.c
parent7f7360a885974e64f27cad05f27f87eaf595caa8 (diff)
merge revision(s) 55609: [Backport #12568]
* vm_args.c (setup_parameters_complex): don't raise ArgumentError if an array is given for instance_exec with optional argument. [ruby-core:76300] [Bug #12568] https://github.com/rails/rails/pull/25699 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index 037fb09c1f..9781bc0580 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -587,6 +587,7 @@ setup_parameters_complex(rb_thread_t * const th, const rb_iseq_t * const iseq,
case arg_setup_lambda:
if (given_argc == 1 &&
given_argc != iseq->body->param.lead_num &&
+ !iseq->body->param.flags.has_opt &&
!iseq->body->param.flags.has_rest &&
args_check_block_arg0(args, th)) {
given_argc = RARRAY_LENINT(args->rest);