diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 21:44:49 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 21:44:49 +0000 |
commit | 0314f93ef402083ea5fd7cb2015f7a98cd0a3358 (patch) | |
tree | 218d0e4eb2db8ae9d1002708eee1f66d9ecdca0f /iseq.c | |
parent | 64bbd55c85a3f3d7c88ba898d81e55f068e9eb7e (diff) | |
download | ruby-0314f93ef402083ea5fd7cb2015f7a98cd0a3358.tar.gz |
* 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.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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))) { |