diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -555,10 +555,11 @@ thread_do_start(rb_thread_t *th, VALUE args) { native_set_thread_name(th); if (!th->first_func) { + const VALUE *ep = vm_proc_ep(th->first_proc); rb_proc_t *proc; GetProcPtr(th->first_proc, proc); th->errinfo = Qnil; - th->root_lep = rb_vm_ep_local_ep(vm_proc_ep(th->first_proc)); + th->root_lep = ep ? rb_vm_ep_local_ep(ep) : NULL; th->root_svar = Qfalse; EXEC_EVENT_HOOK(th, RUBY_EVENT_THREAD_BEGIN, th->self, 0, 0, 0, Qundef); th->value = rb_vm_invoke_proc(th, proc, |