[前][次][番号順一覧][スレッド一覧]

ruby-changes:18053

From: nobu <ko1@a...>
Date: Sat, 4 Dec 2010 08:25:27 +0900 (JST)
Subject: [ruby-changes:18053] Ruby:r30074 (trunk): * vm_insnhelper.c (vm_call_method): revert r30064 and r30071,

nobu	2010-12-04 08:25:19 +0900 (Sat, 04 Dec 2010)

  New Revision: 30074

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30074

  Log:
    * vm_insnhelper.c (vm_call_method): revert r30064 and r30071,
      because of [ruby-core:26761]. Bug#4106 rejected.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_method.rb
    trunk/vm_insnhelper.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30073)
+++ ChangeLog	(revision 30074)
@@ -1,3 +1,8 @@
+Sat Dec  4 08:25:15 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_insnhelper.c (vm_call_method): revert r30064 and r30071,
+	  because of [ruby-core:26761]. Bug#4106 rejected.
+
 Sat Dec  4 07:46:48 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (String#tr_cpp): substitute * with P like as
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 30073)
+++ vm_insnhelper.c	(revision 30074)
@@ -629,7 +629,10 @@
 	    else if (!(flag & VM_CALL_OPT_SEND_BIT) && (me->flag & NOEX_MASK) & NOEX_PROTECTED) {
 		VALUE defined_class = me->klass;
 
-		defined_class = rb_class_real(defined_class);
+		if (RB_TYPE_P(defined_class, T_ICLASS)) {
+		    defined_class = RBASIC(defined_class)->klass;
+		}
+
 		if (!rb_obj_is_kind_of(cfp->self, defined_class)) {
 		    val = vm_method_missing(th, id, recv, num, blockptr, NOEX_PROTECTED);
 		}
Index: test/ruby/test_method.rb
===================================================================
--- test/ruby/test_method.rb	(revision 30073)
+++ test/ruby/test_method.rb	(revision 30074)
@@ -411,25 +411,4 @@
     assert_nothing_raised { v.instance_eval { mv2 } }
     assert_nothing_raised { v.instance_eval { mv3 } }
   end
-
-  def test_protected_singleton
-    bug4106 = '[ruby-core:33506]'
-    a = Class.new do
-      def meth
-        :called
-      end
-      def test
-        a = dup
-        a.extend(Module.new)
-        a.extend(Module.new)
-        class << a
-          protected :meth
-        end
-        a.meth
-      end
-    end.new
-    called = nil
-    assert_nothing_raised(NoMethodError, bug4106) {called = a.test}
-    assert_equal(:called, called, bug4106)
-  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]