summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-03-02 17:39:31 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-03-02 17:39:31 +0900
commit5816725ccc9642101d447b0f3b03c14d232aec6a (patch)
tree2d38d4310b6300c4e7db198658365bc688cdcb5c
parent5c31a4b1186f35a70f2b4ac2a8579b065f008710 (diff)
merge revision(s) 15dbaa0b54f10e43976d594ef987da5f51e0c7c1: [Backport #17622]
[Fixes #17622] Mark and move the previous ep --- vm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
-rw-r--r--version.h6
-rw-r--r--vm.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/version.h b/version.h
index a48e4dce00..b9b3d4abfd 100644
--- a/version.h
+++ b/version.h
@@ -12,11 +12,11 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 42
+#define RUBY_PATCHLEVEL 43
#define RUBY_RELEASE_YEAR 2021
-#define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 26
+#define RUBY_RELEASE_MONTH 3
+#define RUBY_RELEASE_DAY 2
#include "ruby/version.h"
diff --git a/vm.c b/vm.c
index 696cffb202..ee4abb30cf 100644
--- a/vm.c
+++ b/vm.c
@@ -2795,6 +2795,11 @@ rb_execution_context_update(const rb_execution_context_t *ec)
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]));
@@ -2835,6 +2840,11 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
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]);