aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 5a3a14d5ac..86f2d07cd8 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2211,6 +2211,9 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
}
+ else {
+ argv[0] = arg0; /* rb_check_array_type(arg0) may change argv */
+ }
/* keyword argument */
if (iseq->arg_keyword != -1) {