ruby-changes:65247
From: Peter <ko1@a...>
Date: Sat, 13 Feb 2021 04:24:17 +0900 (JST)
Subject: [ruby-changes:65247] 15dbaa0b54 (master): [Fixes #17622] Mark and move the previous ep
https://git.ruby-lang.org/ruby.git/commit/?id=15dbaa0b54 From 15dbaa0b54f10e43976d594ef987da5f51e0c7c1 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Thu, 11 Feb 2021 15:32:19 -0500 Subject: [Fixes #17622] Mark and move the previous ep --- vm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vm.c b/vm.c index 2899433..ef1bf0f 100644 --- a/vm.c +++ b/vm.c @@ -2806,6 +2806,11 @@ rb_execution_context_update(const rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/vm.c#L2806 cfp->block_code = (void *)rb_gc_location((VALUE)cfp->block_code); if (!VM_ENV_LOCAL_P(ep)) { + const VALUE *prev_ep = VM_ENV_PREV_EP(ep); + if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) { + VM_FORCE_WRITE(&prev_ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(prev_ep[VM_ENV_DATA_INDEX_ENV])); + } + if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) { VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ENV], rb_gc_location(ep[VM_ENV_DATA_INDEX_ENV])); VM_FORCE_WRITE(&ep[VM_ENV_DATA_INDEX_ME_CREF], rb_gc_location(ep[VM_ENV_DATA_INDEX_ME_CREF])); @@ -2846,6 +2851,11 @@ rb_execution_context_mark(const rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/vm.c#L2851 rb_gc_mark_movable((VALUE)cfp->block_code); if (!VM_ENV_LOCAL_P(ep)) { + const VALUE *prev_ep = VM_ENV_PREV_EP(ep); + if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) { + rb_gc_mark_movable(prev_ep[VM_ENV_DATA_INDEX_ENV]); + } + if (VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)) { rb_gc_mark_movable(ep[VM_ENV_DATA_INDEX_ENV]); rb_gc_mark(ep[VM_ENV_DATA_INDEX_ME_CREF]); -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/