diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 21:27:48 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 21:27:48 +0000 |
commit | 43c3f447a4d442e0b135220013c89f3742645b37 (patch) | |
tree | 4be1050243cde8f52971b45933b81bcdcd303e0f /proc.c | |
parent | ab936043651396b3f2361cf5c515cf5d1a0a69d0 (diff) | |
download | ruby-43c3f447a4d442e0b135220013c89f3742645b37.tar.gz |
* proc.c: Having optional keyword arguments makes maximum arity +1, not unlimited [#8072]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -877,8 +877,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; } |