summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2022-07-12 16:42:14 -0700
committerAaron Patterson <[email protected]>2022-07-20 13:45:55 -0700
commit1341dea7711ae80aa4c232503fbb5a1be48b648b (patch)
treefc0408924cfa8cd090d93bc3784254b48879fe69 /vm.c
parent32e406d6d3c3ded9160298c4475c1aa188360b07 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6123
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c3
1 files changed, 1 insertions, 2 deletions
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);