summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/-ext-/debug/test_profile_frames.rb4
-rw-r--r--vm_backtrace.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/test/-ext-/debug/test_profile_frames.rb b/test/-ext-/debug/test_profile_frames.rb
index 672c9c4b5a..5ea506046e 100644
--- a/test/-ext-/debug/test_profile_frames.rb
+++ b/test/-ext-/debug/test_profile_frames.rb
@@ -119,8 +119,4 @@ class TestProfileFrames < Test::Unit::TestCase
a
end;
end
-
- def test_start
- assert_equal Bug::Debug.profile_frames(0, 10).tap(&:shift), Bug::Debug.profile_frames(1, 9)
- end
end
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 3a13088855..59340292cf 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -1276,7 +1276,7 @@ rb_profile_frames(int start, int limit, VALUE *buff, int *lines)
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, VALUE *buff, int *lines)
i++;
}
+ cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
return i;