summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-03 04:43:07 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-03 04:43:07 +0000
commitef25be739196ce019f1918736151e0daa0e93f19 (patch)
tree7240be35b2b2e0a699fe10e81989776f0e8cb5b9 /proc.c
parent888e16c51ec6dd4b6aeb94cb44ee70e8f2d102b4 (diff)
* vm_core.h: change semantics of opt_num and opt_table.
`opt_num' was the number of optional parameters + 1. `opt_table' has "opt_num" entries. Change them to: `opt_num' is the number of optional parameters. `opt_talbe' has "opt_num + 1" entries. This change simplify parameter fitting logics. * compile.c: catch up this change. * iseq.c: ditto. * proc.c: ditto. * vm_args.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index 55985752ae..a44cc53bca 100644
--- a/proc.c
+++ b/proc.c
@@ -848,10 +848,8 @@ static inline int
rb_iseq_min_max_arity(const rb_iseq_t *iseq, int *max)
{
*max = iseq->param.flags.has_rest == FALSE ?
- iseq->param.lead_num + iseq->param.post_num +
- iseq->param.opt_num - (iseq->param.flags.has_opt == TRUE) +
- (iseq->param.flags.has_kw == TRUE) +
- (iseq->param.flags.has_kwrest == TRUE)
+ iseq->param.lead_num + iseq->param.opt_num + iseq->param.post_num +
+ (iseq->param.flags.has_kw == TRUE || iseq->param.flags.has_kwrest == TRUE)
: UNLIMITED_ARGUMENTS;
return iseq->param.lead_num + iseq->param.post_num + (iseq->param.flags.has_kw && iseq->param.keyword->required_num > 0);
}