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_insnhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 0660c7dd0..3654e3989 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -623,7 +623,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, defined_class = RBASIC(defined_class)->klass; } - if (!rb_obj_is_kind_of(cfp->self, rb_class_real(defined_class))) { + if (!rb_obj_is_kind_of(cfp->self, defined_class)) { val = vm_method_missing(th, id, recv, num, blockptr, NOEX_PROTECTED); } else { -- cgit