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

ruby-changes:18873

From: yugui <ko1@a...>
Date: Fri, 18 Feb 2011 19:44:20 +0900 (JST)
Subject: [ruby-changes:18873] Ruby:r30898 (ruby_1_9_2): merges r30659 from trunk into ruby_1_9_2.

yugui	2011-02-18 19:43:38 +0900 (Fri, 18 Feb 2011)

  New Revision: 30898

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

  Log:
    merges r30659 from trunk into ruby_1_9_2.
    --
    * class.c (clone_method): add GC guard to prevent intermediate
      variable from GC. [Bug #4321] [ruby-dev:43107]

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/class.c
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 30897)
+++ ruby_1_9_2/ChangeLog	(revision 30898)
@@ -1,3 +1,8 @@
+Wed Jan 26 22:57:30 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
+
+	* class.c (clone_method): add GC guard to prevent intermediate
+	  variable from GC. [Bug #4321] [ruby-dev:43107]
+
 Wed Jan 26 22:28:49 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
 
 	* vm_eval.c (rb_throw_obj): add GC guard to prevent intermediate
Index: ruby_1_9_2/class.c
===================================================================
--- ruby_1_9_2/class.c	(revision 30897)
+++ ruby_1_9_2/class.c	(revision 30898)
@@ -127,11 +127,13 @@
 static int
 clone_method(ID mid, const rb_method_entry_t *me, struct clone_method_data *data)
 {
+    VALUE newiseqval;
     if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) {
-	VALUE newiseqval = rb_iseq_clone(me->def->body.iseq->self, data->klass);
 	rb_iseq_t *iseq;
+	newiseqval = rb_iseq_clone(me->def->body.iseq->self, data->klass);
 	GetISeqPtr(newiseqval, iseq);
 	rb_add_method(data->klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
+	RB_GC_GUARD(newiseqval);
     }
     else {
 	rb_method_entry_set(data->klass, mid, me, me->flag);
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30897)
+++ ruby_1_9_2/version.h	(revision 30898)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 175
+#define RUBY_PATCHLEVEL 176
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

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

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