summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 05:54:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-14 05:54:35 +0000
commit1943242a4688ac0957c279b782d273fdb1f25015 (patch)
tree6abb615150a089ed7073dd8cb1a1a1e4c2c0e10c /thread.c
parentc3f92cf21338d93dccbca9b22dcdf80e9a275cdc (diff)
downloadruby-1943242a4688ac0957c279b782d273fdb1f25015.tar.gz
thread.c: Thread.start with Symbol
* thread.c (thread_do_start): fix segfault at start with Symbol. proc created by Symbol#to_proc does not have environment unless using refinements. [ruby-core:80147] [Bug #13313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 9840880925..fffce53675 100644
--- a/thread.c
+++ b/thread.c
@@ -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,