summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 14:32:49 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 14:32:49 +0000
commitc967493b653c9af32f9850876f4ff145add33d77 (patch)
tree336ad5223d74b44df57efe4b9a0a81965b292924 /vm_method.c
parent96de351eed005e27aee3c11005aa53e0d0b5133c (diff)
merge revision(s) 40346: [Backport #8284]
* 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/branches/ruby_2_0_0@40427 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 951ee4e6a8..e00c282ca9 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1359,7 +1359,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;
}
@@ -1382,7 +1382,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;
}