summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-30 02:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-30 02:16:15 +0000
commite95e524782360babafc9d3754bbbda4f266bea98 (patch)
tree8e82ceabca8055a955fa49e2013adafcc3cf3cb1 /vm_insnhelper.c
parent44d2958e3b6ba71de033b7f84960c3283558f755 (diff)
vm_insnhelper.c: allow to_ary
* vm_insnhelper.c (vm_callee_setup_arg{_complex,}): try conversion by to_ary for a lambda, as well as a proc. [ruby-core:65887] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 495b7224fd..e3e91729b0 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1140,7 +1140,7 @@ vm_callee_setup_arg_complex(rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t
long len;
if (!splattable ||
argc != 1 ||
- !RB_TYPE_P(arg0 = argv[0], T_ARRAY) ||
+ NIL_P(arg0 = rb_check_array_type(argv[0])) ||
(len = RARRAY_LEN(arg0)) < (long)min ||
(len > (long)max && max != UNLIMITED_ARGUMENTS)) {
argument_error(iseq, argc, min, max);
@@ -1238,7 +1238,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t *iseq,
long len;
if (!(is_lambda > 1) ||
ci->argc != 1 ||
- !RB_TYPE_P(arg0 = argv[0], T_ARRAY) ||
+ NIL_P(arg0 = rb_check_array_type(argv[0])) ||
(len = RARRAY_LEN(arg0)) != (long)iseq->argc) {
argument_error(iseq, ci->argc, iseq->argc, iseq->argc);
}