summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-12-05 06:01:37 (GMT)
committerKoichi Sasada <ko1@atdot.net>2019-12-05 06:57:23 (GMT)
commitee579200082329db66e153c465cb8332e55bacb2 (patch)
treec0ae672c64db788ef2358e8327c73924be4aa5cc /thread.c
parentb40bb27e3594bbc2e9c9ac00dfa5612ebae3151b (diff)
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>.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 1 insertions, 1 deletions
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)
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)
}
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);