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

ruby-changes:15492

From: naruse <ko1@a...>
Date: Mon, 19 Apr 2010 03:01:23 +0900 (JST)
Subject: [ruby-changes:15492] Ruby:r27393 (trunk): * vm_method.c (rb_add_method_def): workarond fix for redefinition

naruse	2010-04-19 02:59:56 +0900 (Mon, 19 Apr 2010)

  New Revision: 27393

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

  Log:
    * vm_method.c (rb_add_method_def): workarond fix for redefinition
      of methods. This is because cfp->me uses the rb_method_entry
      which is freed by redefinition of remove_method. Note that
      reusing may cause another problem when the usage is changed.
      [ruby-core:27320] [ruby-core:29464]

  Modified files:
    trunk/ChangeLog
    trunk/vm_method.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27392)
+++ ChangeLog	(revision 27393)
@@ -1,3 +1,11 @@
+Mon Apr 19 00:27:03 2010  NARUSE, Yui  <naruse@r...>
+
+	* vm_method.c (rb_add_method_def): workarond fix for redefinition
+	  of methods. This is because cfp->me uses the rb_method_entry
+	  which is freed by redefinition of remove_method. Note that
+	  reusing may cause another problem when the usage is changed.
+	  [ruby-core:27320] [ruby-core:29464]
+
 Sun Apr 18 22:13:21 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (string_content): cond_stack and cmdarg_stack are VALUE.
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 27392)
+++ vm_method.c	(revision 27393)
@@ -210,12 +210,18 @@
 				   rb_id2name(old_def->original_id));
 	    }
 	}
-	rb_free_method_entry(old_me);
+
+	/* FIXME: this avoid to free methods used in cfp, but reusing may cause
+	 * another problem when the usage is changed.
+	 */
+	me = old_me;
     }
+    else {
+	me = ALLOC(rb_method_entry_t);
+    }
 
     rb_clear_cache_by_id(mid);
 
-    me = ALLOC(rb_method_entry_t);
     me->flag = NOEX_WITH_SAFE(noex);
     me->called_id = mid;
     me->klass = klass;

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

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