ruby-changes:59089
From: Koichi <ko1@a...>
Date: Thu, 5 Dec 2019 19:35:43 +0900 (JST)
Subject: [ruby-changes:59089] ee57920008 (master): move an interrupt point.
https://git.ruby-lang.org/ruby.git/commit/?id=ee57920008 From ee579200082329db66e153c465cb8332e55bacb2 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Thu, 5 Dec 2019 15:01:37 +0900 Subject: move an interrupt point. `args_ptr` can be corrupted by interrupt handlers. Pointed by nagachika <https://ruby-trunk-changes.hatenablog.com/entry/ruby_trunk_changes_20191204>. diff --git a/thread.c b/thread.c index d1bf612..8d4b283 100644 --- a/thread.c +++ b/thread.c @@ -681,6 +681,7 @@ thread_do_start(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/thread.c#L681 th->ec->root_svar = Qfalse; EXEC_EVENT_HOOK(th->ec, RUBY_EVENT_THREAD_BEGIN, th->self, 0, 0, 0, Qundef); + vm_check_ints_blocking(th->ec); if (args_len < 8) { /* free proc.args if the length is enough small */ @@ -693,7 +694,6 @@ thread_do_start(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/thread.c#L694 } rb_adjust_argv_kw_splat(&args_len, &args_ptr, &kw_splat); - vm_check_ints_blocking(th->ec); th->value = rb_vm_invoke_proc(th->ec, proc, args_len, args_ptr, kw_splat, VM_BLOCK_HANDLER_NONE); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/