From a2e7f654fff4c2d0c4d5ea3d79590674ff998688 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 6 Jul 2015 18:44:54 +0000 Subject: * vm_core.h: remove rb_iseq_t::klass to reduce dynamic data. * internal.h, iseq.c (rb_iseq_klass): remove it because rb_iseq_t::klass is removed. * vm_insnhelper.c (vm_super_outside): do not see cfp->iseq, but check callable method entry on a frame. This fix simplify the logic to search super class. * test/ruby/test_method.rb: support super() from Proc. Now, [Bug #4881] and [Bug #3136] was solved. * proc.c (rb_mod_define_method): catch up this change. * vm.c (vm_define_method): ditto. * vm_backtrace.c (rb_profile_frames): now, each `frame' objects are rb_callable_method_entry_t data or iseq VALUEs. This fix introduce minor compatibility issue that rb_profile_frame_label() always returns rb_profile_frame_base_label(). * test/-ext-/debug/test_profile_frames.rb: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/debug/test_profile_frames.rb | 8 ++++---- test/ruby/test_method.rb | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/-ext-/debug/test_profile_frames.rb b/test/-ext-/debug/test_profile_frames.rb index 1879c222c2..e257ef09b3 100644 --- a/test/-ext-/debug/test_profile_frames.rb +++ b/test/-ext-/debug/test_profile_frames.rb @@ -25,12 +25,12 @@ class TestProfileFrames < Test::Unit::TestCase }.resume labels = [ - "block (2 levels) in test_profile_frames", + "test_profile_frames", "zab", "baz", "bar", "foo", - "block in test_profile_frames", + "test_profile_frames", ] base_labels = [ "test_profile_frames", @@ -41,12 +41,12 @@ class TestProfileFrames < Test::Unit::TestCase "test_profile_frames", ] full_labels = [ - "block (2 levels) in TestProfileFrames#test_profile_frames", + "TestProfileFrames#test_profile_frames", "#{obj.inspect}.zab", "SampleClassForTestProfileFrames::Sample2#baz", "SampleClassForTestProfileFrames.bar", "SampleClassForTestProfileFrames#foo", - "block in TestProfileFrames#test_profile_frames", + "TestProfileFrames#test_profile_frames", ] classes = [ TestProfileFrames, diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 5de28cbbec..71d3b30dbf 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -405,11 +405,7 @@ class TestMethod < Test::Unit::TestCase end } c2 = Class.new(c1) { define_method(:m) { Proc.new { super() } } } - # c2.new.m.call should return :m1, but currently it raise NoMethodError. - # see [Bug #4881] and [Bug #3136] - assert_raise(NoMethodError) { - c2.new.m.call - } + assert_equal(:m1, c2.new.m.call, 'see [Bug #4881] and [Bug #3136]') end def test_clone -- cgit v1.2.3