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

ruby-changes:39080

From: ko1 <ko1@a...>
Date: Mon, 6 Jul 2015 18:02:47 +0900 (JST)
Subject: [ruby-changes:39080] ko1:r51161 (trunk): * vm_insnhelper.c (vm_search_super_method): do not skip calling

ko1	2015-07-06 18:02:34 +0900 (Mon, 06 Jul 2015)

  New Revision: 51161

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

  Log:
    * vm_insnhelper.c (vm_search_super_method): do not skip calling
      same methods in super.
      [Bug #3351]
    * test/ruby/test_super.rb: fix a test.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_super.rb
    trunk/vm_insnhelper.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51160)
+++ ChangeLog	(revision 51161)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul  6 17:59:05 2015  Koichi Sasada  <ko1@a...>
+
+	* vm_insnhelper.c (vm_search_super_method): do not skip calling
+	  same methods in super.
+	  [Bug #3351]
+
+	* test/ruby/test_super.rb: fix a test.
+
 Mon Jul  6 17:59:11 2015  SHIBATA Hiroshi  <hsbt@r...>
 
 	* ext/tk/tcltklib.c: removed deprecated safe level.
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 51160)
+++ vm_insnhelper.c	(revision 51161)
@@ -2277,15 +2277,6 @@ vm_search_super_method(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2277
     /* TODO: use inline cache */
     ci->me = rb_callable_method_entry(ci->klass, ci->mid);
     ci->call = vm_call_super_method;
-
-    while (iseq && !iseq->klass) {
-	iseq = iseq->parent_iseq;
-    }
-
-    if (ci->me && ci->me->def->type == VM_METHOD_TYPE_ISEQ && def_iseq_ptr(ci->me->def) == iseq) {
-	ci->klass = RCLASS_SUPER(ci->me->defined_class);
-	ci->me = rb_callable_method_entry(ci->klass, ci->mid);
-    }
 }
 
 /* yield */
Index: test/ruby/test_super.rb
===================================================================
--- test/ruby/test_super.rb	(revision 51160)
+++ test/ruby/test_super.rb	(revision 51161)
@@ -228,11 +228,8 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_super.rb#L228
     A.send(:include, Override)
   end
 
-  # [Bug #3351]
   def test_double_include
-    assert_equal([:Base, :Override], DoubleInclude::B.new.foo)
-    # should be changed as follows?
-    # assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo)
+    assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo, "[Bug #3351]")
   end
 
   module DoubleInclude2

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

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