diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-04 03:47:02 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-04 03:47:02 +0000 |
commit | dd87e463106ade202e3b04e7703a91e438c027d6 (patch) | |
tree | 81244f370cffbb23bde2a64a2810e890e83f37bb /vm_insnhelper.c | |
parent | 5be464239560765b08fa6379b3f6b902c9236877 (diff) |
Add more comment about r41041
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index d7515cd177..061b020930 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -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 */ |