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

ruby-changes:33203

From: normal <ko1@a...>
Date: Fri, 7 Mar 2014 19:21:46 +0900 (JST)
Subject: [ruby-changes:33203] normal:r45282 (trunk): vm_eval.c: fix misplaced GC guard

normal	2014-03-07 19:21:28 +0900 (Fri, 07 Mar 2014)

  New Revision: 45282

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

  Log:
    vm_eval.c: fix misplaced GC guard
    
    * vm_eval.c (vm_call0_body): fix RB_GC_GUARD location
      (check_funcall_exec): ditto

  Modified files:
    trunk/ChangeLog
    trunk/vm_eval.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45281)
+++ ChangeLog	(revision 45282)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Mar  7 19:14:11 2014  Eric Wong  <e@8...>
+
+	* vm_eval.c (vm_call0_body): fix RB_GC_GUARD location
+	  (check_funcall_exec): ditto
+	  [Bug #9609]
+
 Fri Mar  7 14:48:17 2014  Narihiro Nakamura  <authornari@g...>
 
 	* parse.y (ENC_SINGLE): Unused macro removed.
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 45281)
+++ vm_eval.c	(revision 45282)
@@ -210,10 +210,11 @@ vm_call0_body(rb_thread_t* th, rb_call_i https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L210
 	{
 	    VALUE new_args = rb_ary_new4(ci->argc, argv);
 
-	    RB_GC_GUARD(new_args);
 	    rb_ary_unshift(new_args, ID2SYM(ci->mid));
 	    th->passed_block = ci->blockptr;
-	    return rb_funcall2(ci->recv, idMethodMissing, ci->argc+1, RARRAY_PTR(new_args));
+	    ret = rb_funcall2(ci->recv, idMethodMissing, ci->argc+1, RARRAY_PTR(new_args));
+	    RB_GC_GUARD(new_args);
+	    return ret;
 	}
       case VM_METHOD_TYPE_OPTIMIZED:
 	switch (ci->me->def->body.optimize_type) {
@@ -338,11 +339,13 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L339
 check_funcall_exec(struct rescue_funcall_args *args)
 {
     VALUE new_args = rb_ary_new4(args->argc, args->argv);
+    VALUE ret;
 
-    RB_GC_GUARD(new_args);
     rb_ary_unshift(new_args, args->sym);
-    return rb_funcall2(args->recv, idMethodMissing,
+    ret = rb_funcall2(args->recv, idMethodMissing,
 		       args->argc+1, RARRAY_PTR(new_args));
+    RB_GC_GUARD(new_args);
+    return ret;
 }
 
 static VALUE

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

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