diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-14 06:52:44 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-14 06:52:44 +0000 |
commit | 86bf94933368d25739fa5348ca8ff6e2c0d11353 (patch) | |
tree | 0ea0ae6e9ba4842ab76a951eb60fd4cdb07abe89 /thread.c | |
parent | 6f01a32d319bc1a57f445aef959449a05df71575 (diff) | |
download | ruby-86bf94933368d25739fa5348ca8ff6e2c0d11353.tar.gz |
Fiber also has same issue. [Bug #13313]
* thread.c (rb_vm_proc_local_ep): added.
* cont.c (rb_fiber_start): use rb_vm_proc_local_ep().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -550,16 +550,28 @@ ruby_thread_init_stack(rb_thread_t *th) native_thread_init_stack(th); } +const VALUE * +rb_vm_proc_local_ep(VALUE proc) +{ + const VALUE *ep = vm_proc_ep(proc); + + if (ep) { + return rb_vm_ep_local_ep(ep); + } + else { + return NULL; + } +} + static void 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 = ep ? rb_vm_ep_local_ep(ep) : NULL; + th->root_lep = rb_vm_proc_local_ep(th->first_proc); 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, |