diff --git a/cont.c b/cont.c index 95f2de9b87..7a24ec5e53 100644 --- a/cont.c +++ b/cont.c @@ -1833,10 +1833,8 @@ rb_fiber_yield(int argc, const VALUE *argv) } void -rb_fiber_reset_root_local_storage(VALUE thval) +rb_fiber_reset_root_local_storage(rb_thread_t *th) { - rb_thread_t *th = rb_thread_ptr(thval); - if (th->root_fiber && th->root_fiber != th->ec->fiber_ptr) { th->ec->local_storage = th->root_fiber->cont.saved_ec.local_storage; } diff --git a/internal.h b/internal.h index e10fe670d7..8510ed2d1e 100644 --- a/internal.h +++ b/internal.h @@ -1374,9 +1374,10 @@ VALUE rb_complex_sqrt(VALUE x); VALUE rb_dbl_complex_polar_pi(double abs, double ang); VALUE rb_complex_pow(VALUE self, VALUE other); +struct rb_thread_struct; /* cont.c */ VALUE rb_obj_is_fiber(VALUE); -void rb_fiber_reset_root_local_storage(VALUE); +void rb_fiber_reset_root_local_storage(struct rb_thread_struct *); void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE (*rollback_func)(ANYARGS)); /* debug.c */ diff --git a/vm.c b/vm.c index f7d4b65f67..f487bd881a 100644 --- a/vm.c +++ b/vm.c @@ -2201,7 +2201,7 @@ ruby_vm_destruct(rb_vm_t *vm) struct rb_objspace *objspace = vm->objspace; vm->main_thread = 0; if (th) { - rb_fiber_reset_root_local_storage(th->self); + rb_fiber_reset_root_local_storage(th); thread_free(th); } rb_vm_living_threads_init(vm);