summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-01 08:17:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-01 08:17:58 +0000
commitf35b09c108d22c5717896dee7fed694c434a94b2 (patch)
treef8cb2d1a1619e974bba76337d088aee5da84dd38 /vm_method.c
parentc0e2f9278ee2649d98e6750a5e6bfc5d36b4db20 (diff)
vm_method.c: orignial visibilities
* vm_method.c (Init_eval_method): copy the orignial visibilities, instead of setting explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/vm_method.c b/vm_method.c
index 5a8439649a..3f12c19ac7 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1892,11 +1892,13 @@ Init_eval_method(void)
"private", top_private, -1);
{
-#define REPLICATE_METHOD(klass, id, visi) \
- rb_method_entry_set((klass), (id), rb_method_entry((klass), (id), 0), (visi));
-
- 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);
+#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);
+ REPLICATE_METHOD(rb_eException, idRespond_to);
+ REPLICATE_METHOD(rb_eException, idRespond_to_missing);
}
}