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. --- cont.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cont.c') diff --git a/cont.c b/cont.c index 36f47d9ee6..590d6c250f 100644 --- a/cont.c +++ b/cont.c @@ -1194,6 +1194,12 @@ cont_init_mjit_cont(rb_context_t *cont) } } +struct rb_execution_context_struct * +rb_fiberptr_get_ec(struct rb_fiber_struct *fiber) +{ + return &fiber->cont.saved_ec; +} + static void cont_init(rb_context_t *cont, rb_thread_t *th) { -- cgit v1.2.1