summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 21:44:49 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 21:44:49 +0000
commit0314f93ef402083ea5fd7cb2015f7a98cd0a3358 (patch)
tree218d0e4eb2db8ae9d1002708eee1f66d9ecdca0f /iseq.c
parent64bbd55c85a3f3d7c88ba898d81e55f068e9eb7e (diff)
* iseq.c (rb_iseq_parameters): fix limit for optional arguments.
* test/ruby/test_keyword.rb: tests for above. * vm_core.h (struct rb_iseq_struct): update documentation with keyword arguments. [Bug #7540] [ruby-core:50735] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/iseq.c b/iseq.c
index 78e33b0d96..9fb82d49c6 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1792,12 +1792,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
rb_ary_push(args, PARAM(i, req));
}
}
- r = iseq->arg_rest != -1 ? iseq->arg_rest :
- iseq->arg_post_len > 0 ? iseq->arg_post_start :
- iseq->arg_block != -1 ? iseq->arg_block :
- iseq->arg_keyword != -1 ? iseq->arg_keyword :
- iseq->arg_size;
- if (iseq->arg_keyword != -1) r -= iseq->arg_keywords;
+ r = iseq->argc + iseq->arg_opts - 1;
for (; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2str(PARAM_ID(i))) {