From 98ac9b866747306edd7cd9437d74c7af51a3a9da Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 24 Oct 2010 05:11:26 +0000 Subject: * vm.c (vm_define_method): defined method is run with the default public visibility regardless the visibility context of definition. [ruby-core:30638] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/ruby/test_module.rb | 1 - vm.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6d4a63c020..c5a581c7ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 24 14:11:16 2010 Nobuyoshi Nakada + + * vm.c (vm_define_method): defined method is run with the default + public visibility regardless the visibility context of definition. + [ruby-core:30638] + Sun Oct 24 12:08:54 2010 Aaron Patterson * lib/test/unit.rb: make test/unit play nicely with the rake test diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 0e4737dea6..e5f1e69749 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -929,7 +929,6 @@ class TestModule < Test::Unit::TestCase def test_attr_inherited_visibility bug3406 = '[ruby-core:30638]' - skip(bug3406) c = Class.new do class << self private diff --git a/vm.c b/vm.c index 084c30964a..9137a4dc3a 100644 --- a/vm.c +++ b/vm.c @@ -1868,6 +1868,7 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, /* dup */ COPY_CREF(miseq->cref_stack, cref); + miseq->cref_stack->nd_visi = NOEX_PUBLIC; miseq->klass = klass; miseq->defined_method_id = id; rb_add_method(klass, id, VM_METHOD_TYPE_ISEQ, miseq, noex); -- cgit v1.2.3