From 1341dea7711ae80aa4c232503fbb5a1be48b648b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 12 Jul 2022 16:42:14 -0700 Subject: Prevent the stack from being marked twice This commit prevents the stack from being marked twice: once via the Fiber, and once via the Thread. It introduces an assertion to assert that the ec on the thread is the same as the ec on the Fiber being marked via the thread. --- vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index c2dda3fdc4..4538c8b607 100644 --- a/vm.c +++ b/vm.c @@ -3138,8 +3138,7 @@ thread_mark(void *ptr) RUBY_MARK_UNLESS_NULL(th->top_wrapper); if (th->root_fiber) rb_fiber_mark_self(th->root_fiber); - /* Ensure EC stack objects are pinned */ - rb_execution_context_mark(th->ec); + RUBY_ASSERT(th->ec == rb_fiberptr_get_ec(th->ec->fiber_ptr)); RUBY_MARK_UNLESS_NULL(th->stat_insn_usage); RUBY_MARK_UNLESS_NULL(th->last_status); RUBY_MARK_UNLESS_NULL(th->locking_mutex); -- cgit v1.2.3