summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-22 07:28:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-22 07:28:00 +0000
commit5c0515f2e25bdebe4f27eb8d3df5761ad4304bd0 (patch)
tree4622008d818e3118bf286515dc2c2f80022b828f /vm_insnhelper.c
parente8a71e64a15c46388e1abf293fa81df3ebfc5643 (diff)
* vm_insnhelper.c (vm_yield_setup_args): should not drop arguments
corresponding to default paramters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 553883c035..2e862492f3 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -728,12 +728,13 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq,
}
if (iseq->arg_rest == -1) {
- if (m < argc) {
+ const int arg_size = iseq->arg_size;
+ if (arg_size < argc) {
/*
* yield 1, 2
* => {|a|} # truncate
*/
- th->mark_stack_len = argc = m;
+ th->mark_stack_len = argc = arg_size;
}
}
else {