summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-28 02:50:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-28 02:50:57 +0000
commit0ea1e43174a5b75682fc19789ea8dbeeb5b10ec6 (patch)
tree149962c55453d9d3461181944a0663de822e0080 /vm_insnhelper.c
parentd5a39c0aa85a705fcf360a535a278aed9116f644 (diff)
vm_insnhelper.c: no splat single opt arg
* vm_insnhelper.c (vm_yield_setup_block_args): pass single argument to single optional parameter unchanged without splatting. [Bug #7621] [ruby-dev:46801] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index c65135adab..ad21b99e56 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2092,7 +2092,7 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
*/
arg0 = argv[0];
if (!(iseq->arg_simple & 0x02) && /* exclude {|a|} */
- (m + iseq->arg_opts + iseq->arg_post_len) > 0 && /* this process is meaningful */
+ ((m + iseq->arg_post_len) > 0 || iseq->arg_opts > 2) && /* this process is meaningful */
argc == 1 && !NIL_P(ary = rb_check_array_type(arg0))) { /* rhs is only an array */
th->mark_stack_len = argc = RARRAY_LENINT(ary);