diff options
-rw-r--r-- | vm_backtrace.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1593,7 +1593,7 @@ thread_profile_frames(rb_execution_context_t *ec, int start, int limit, VALUE *b // Skip dummy frame; see `rb_ec_partial_backtrace_object` for details end_cfp = RUBY_VM_NEXT_CONTROL_FRAME(end_cfp); - for (i=0; i<limit && cfp != end_cfp;) { if (VM_FRAME_RUBYFRAME_P(cfp) && cfp->pc != 0) { if (start > 0) { start--; @@ -1627,12 +1627,15 @@ thread_profile_frames(rb_execution_context_t *ec, int start, int limit, VALUE *b else { cme = rb_vm_frame_method_entry(cfp); if (cme && cme->def->type == VM_METHOD_TYPE_CFUNC) { buff[i] = (VALUE)cme; if (lines) lines[i] = 0; i++; } } - cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp); } return i; |