From b8b43fbdbea07bfa8e0f2d3ca65871d80b7c903e Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 1 Mar 2014 12:01:29 +0000 Subject: merge revision(s) 44432: [Backport #9299] * proc.c: Having optional keyword arguments makes maximum arity +1, not unlimited [#8072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 9c88ada316..e3cecb7bbe 100644 --- a/proc.c +++ b/proc.c @@ -825,8 +825,9 @@ proc_arity(VALUE self) static inline int rb_iseq_min_max_arity(const rb_iseq_t *iseq, int *max) { - *max = (iseq->arg_rest == -1 && iseq->arg_keyword == -1) ? - iseq->argc + iseq->arg_post_len + iseq->arg_opts - (iseq->arg_opts > 0) + *max = iseq->arg_rest == -1 ? + iseq->argc + iseq->arg_post_len + iseq->arg_opts - + (iseq->arg_opts > 0) + (iseq->arg_keyword != -1) : UNLIMITED_ARGUMENTS; return iseq->argc + iseq->arg_post_len + (iseq->arg_keyword_required > 0); } -- cgit v1.2.3