summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 06:52:44 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 06:52:44 +0000
commit3651c0aa00747c584fadeeae2d9bf50da4ed675a (patch)
tree0ea0ae6e9ba4842ab76a951eb60fd4cdb07abe89 /thread.c
parent1943242a4688ac0957c279b782d273fdb1f25015 (diff)
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.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index fffce53675..705b456ccb 100644
--- a/thread.c
+++ b/thread.c
@@ -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,