Add more comment about r41041
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5be4642395
commit
dd87e46310
@ -2212,9 +2212,13 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
|
|||||||
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
|
MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argv[0] = arg0; /* rb_check_array_type(arg0) may change argv */
|
/* vm_push_frame current argv is at the top of sp because vm_invoke_block
|
||||||
/* when to_ary method is invoked and the stack is overwritten, */
|
* set sp at the first element of argv.
|
||||||
/* so need to restore argv[0]. */
|
* Therefore when rb_check_array_type(arg0) called to_ary and called to_ary
|
||||||
|
* or method_missing run vm_push_frame, it initializes local variables.
|
||||||
|
* see also https://bugs.ruby-lang.org/issues/8484
|
||||||
|
*/
|
||||||
|
argv[0] = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* keyword argument */
|
/* keyword argument */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user