From e2277a5eaf663b0d1eb7d4985ffca1fdb00be0d1 Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 16 Nov 2009 07:01:44 +0000 Subject: * vm_insnhelper.c (vm_call_method): protected singleton methods of an object should not be able to called from other instances of the class of the object. [ruby-core:26761] * vm_eval.c (rb_method_call_status): ditto. * test/ruby/test_module.rb (test_protected_singleton_method): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index e24f1c3d7..a0e35bd71 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -343,7 +343,7 @@ rb_method_call_status(rb_thread_t *th, rb_method_entry_t *me, call_type scope, V if (self == Qundef) { self = th->cfp->self; } - if (!rb_obj_is_kind_of(self, rb_class_real(defined_class))) { + if (!rb_obj_is_kind_of(self, defined_class)) { return NOEX_PROTECTED; } } -- cgit