1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Handle (empty) backtrace when thread is not born yet.

This commit is contained in:
Samuel Williams 2019-06-06 09:54:29 +12:00
parent 5855af73b8
commit 9cb4e7725f

View file

@ -451,6 +451,12 @@ backtrace_each(const rb_execution_context_t *ec,
const rb_control_frame_t *cfp;
ptrdiff_t size, i;
// In the case the thread vm_stack or cfp is not initialized, there is no backtrace.
if (start_cfp == NULL) {
init(arg, 0);
return;
}
/* <- start_cfp (end control frame)
* top frame (dummy)
* top frame (dummy)