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

ruby-changes:2020

From: ko1@a...
Date: 25 Sep 2007 21:42:21 +0900
Subject: [ruby-changes:2020] matz - Ruby:r13511 (trunk): * eval_method.ci (remove_method): should not remove undef place

matz	2007-09-25 21:41:48 +0900 (Tue, 25 Sep 2007)

  New Revision: 13511

  Modified files:
    trunk/ChangeLog
    trunk/eval_method.ci

  Log:
    * eval_method.ci (remove_method): should not remove undef place
      holder.  [ruby-dev:31816], [ruby-dev:31817]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13511&r2=13510
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval_method.ci?r1=13511&r2=13510

Index: eval_method.ci
===================================================================
--- eval_method.ci	(revision 13510)
+++ eval_method.ci	(revision 13511)
@@ -305,8 +305,14 @@
     if (mid == object_id || mid == __send || mid == __send_bang || mid == init) {
 	rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
     }
-    if (!st_delete(RCLASS(klass)->m_tbl, &mid, &data) ||
-	!(body = (NODE *)data) || !body->nd_body) {
+    if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) {
+	body = (NODE *)data;
+	if (!body || !body->nd_body) body = 0;
+	else {
+	    st_delete(RCLASS(klass)->m_tbl, &mid, &data);
+	}
+    }
+    if (!body) {
 	rb_name_error(mid, "method `%s' not defined in %s",
 		      rb_id2name(mid), rb_class2name(klass));
     }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13510)
+++ ChangeLog	(revision 13511)
@@ -1,3 +1,8 @@
+Tue Sep 25 13:43:03 2007  Yukihiro Matsumoto  <matz@r...>
+
+	* eval_method.ci (remove_method): should not remove undef place
+	  holder.  [ruby-dev:31816], [ruby-dev:31817]
+
 Tue Sep 25 09:51:31 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* eval.c (rb_longjmp): source file information may be NULL.

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

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