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

ruby-changes:39006

From: nobu <ko1@a...>
Date: Wed, 1 Jul 2015 17:18:08 +0900 (JST)
Subject: [ruby-changes:39006] nobu:r51087 (trunk): vm_method.c: orignial visibilities

nobu	2015-07-01 17:17:58 +0900 (Wed, 01 Jul 2015)

  New Revision: 51087

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

  Log:
    vm_method.c: orignial visibilities
    
    * vm_method.c (Init_eval_method): copy the orignial visibilities,
      instead of setting explicitly.

  Modified files:
    trunk/vm_method.c
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 51086)
+++ vm_method.c	(revision 51087)
@@ -1892,11 +1892,13 @@ Init_eval_method(void) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1892
 			     "private", top_private, -1);
 
     {
-#define REPLICATE_METHOD(klass, id, visi) \
-  rb_method_entry_set((klass), (id), rb_method_entry((klass), (id), 0), (visi));
+#define REPLICATE_METHOD(klass, id) do { \
+	    const rb_method_entry_t *me = rb_method_entry((klass), (id), 0); \
+	    rb_method_entry_set((klass), (id), me, METHOD_ENTRY_VISI(me)); \
+	} while (0)
 
-	REPLICATE_METHOD(rb_eException, idMethodMissing, METHOD_VISI_PRIVATE);
-	REPLICATE_METHOD(rb_eException, idRespond_to, METHOD_VISI_PUBLIC);
-	REPLICATE_METHOD(rb_eException, idRespond_to_missing, METHOD_VISI_PUBLIC);
+	REPLICATE_METHOD(rb_eException, idMethodMissing);
+	REPLICATE_METHOD(rb_eException, idRespond_to);
+	REPLICATE_METHOD(rb_eException, idRespond_to_missing);
     }
 }

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

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