ruby-changes:51060
From: tenderlove <ko1@a...>
Date: Fri, 27 Apr 2018 09:13:57 +0900 (JST)
Subject: [ruby-changes:51060] tenderlove:r63267 (trunk): Revert "Fix use of `rb_profile_frames` start parameter"
tenderlove 2018-04-27 09:13:51 +0900 (Fri, 27 Apr 2018) New Revision: 63267 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63267 Log: Revert "Fix use of `rb_profile_frames` start parameter" This reverts commit r63265. ko1 said I should not have committed this! I'm sorry! Modified files: trunk/test/-ext-/debug/test_profile_frames.rb trunk/vm_backtrace.c Index: test/-ext-/debug/test_profile_frames.rb =================================================================== --- test/-ext-/debug/test_profile_frames.rb (revision 63266) +++ test/-ext-/debug/test_profile_frames.rb (revision 63267) @@ -119,8 +119,4 @@ class TestProfileFrames < Test::Unit::Te https://github.com/ruby/ruby/blob/trunk/test/-ext-/debug/test_profile_frames.rb#L119 a end; end - - def test_start - assert_equal Bug::Debug.profile_frames(0, 10).tap(&:shift), Bug::Debug.profile_frames(1, 9) - end end Index: vm_backtrace.c =================================================================== --- vm_backtrace.c (revision 63266) +++ vm_backtrace.c (revision 63267) @@ -1276,7 +1276,7 @@ rb_profile_frames(int start, int limit, https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1276 const rb_control_frame_t *cfp = ec->cfp, *end_cfp = RUBY_VM_END_CONTROL_FRAME(ec); const rb_callable_method_entry_t *cme; - for (i=0; i<limit && cfp != end_cfp; cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)) { + for (i=0; i<limit && cfp != end_cfp;) { if (cfp->iseq && cfp->pc) { if (start > 0) { start--; @@ -1296,6 +1296,7 @@ rb_profile_frames(int start, int limit, https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1296 i++; } + cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp); } return i; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/