1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
naruse 2013-06-04 03:47:02 +00:00
parent 5be4642395
commit dd87e46310

View file

@ -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);
}
else {
argv[0] = arg0; /* rb_check_array_type(arg0) may change argv */
/* when to_ary method is invoked and the stack is overwritten, */
/* so need to restore argv[0]. */
/* vm_push_frame current argv is at the top of sp because vm_invoke_block
* set sp at the first element of argv.
* 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 */