[前][次][番号順一覧][スレッド一覧]

ruby-changes:29005

From: naruse <ko1@a...>
Date: Tue, 4 Jun 2013 12:47:14 +0900 (JST)
Subject: [ruby-changes:29005] naruse:r41057 (trunk): Add more comment about r41041

naruse	2013-06-04 12:47:02 +0900 (Tue, 04 Jun 2013)

  New Revision: 41057

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41057

  Log:
    Add more comment about r41041

  Modified files:
    trunk/vm_insnhelper.c

Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 41056)
+++ vm_insnhelper.c	(revision 41057)
@@ -2212,9 +2212,13 @@ vm_yield_setup_block_args(rb_thread_t *t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2212
 	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 */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]