summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 07:59:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 07:59:06 +0000
commit335dfa1255eb38d765d3b35d8b9f9d176eb5e830 (patch)
tree93c54175c94adbf9b1605e3c31c57e44412f9ac9 /vm_method.c
parenta4188556d3735aec2fba15372f73826c16d1af05 (diff)
vm_method.c: fix visibility on anonymous module
* vm_method.c (rb_mod_public_method): fix visibility on anonymous module. set visibility of singleton method, not method in base class. [ruby-core:54404] [Bug #8284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_method.c b/vm_method.c
index b4c45180d6..badc20eb37 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1374,7 +1374,7 @@ rb_mod_private(int argc, VALUE *argv, VALUE module)
static VALUE
rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
{
- set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PUBLIC);
+ set_method_visibility(rb_singleton_class(obj), argc, argv, NOEX_PUBLIC);
return obj;
}
@@ -1400,7 +1400,7 @@ rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
static VALUE
rb_mod_private_method(int argc, VALUE *argv, VALUE obj)
{
- set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PRIVATE);
+ set_method_visibility(rb_singleton_class(obj), argc, argv, NOEX_PRIVATE);
return obj;
}