aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-08-05 11:32:42 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-08-05 13:31:58 -0700
commit81252c5ccd15295155a8fe30b0b56117ba7c79e7 (patch)
tree05cb7e325bbd51591a0f943c6778c118e84a1be5
parentc9192ef2e8793fd870a4af40f422bc939a135ef9 (diff)
downloadruby-81252c5ccd15295155a8fe30b0b56117ba7c79e7.tar.gz
Let prev EP move again
The last time we committed this, we were asking the VM to write to the ep. But VM assertions check if the ENV data is the correct type, which if it's a T_MOVED pointer it's not the correct type. So the vm assertions would fail. This time we just directly write to it from the GC and that bypasses the vm assertion checks.
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 7bbc125d80..eacc609f6f 100644
--- a/gc.c
+++ b/gc.c
@@ -5028,7 +5028,7 @@ gc_mark_imemo(rb_objspace_t *objspace, VALUE obj)
GC_ASSERT(VM_ENV_ESCAPED_P(env->ep));
gc_mark_values(objspace, (long)env->env_size, env->env);
VM_ENV_FLAGS_SET(env->ep, VM_ENV_FLAG_WB_REQUIRED);
- gc_mark_and_pin(objspace, (VALUE)rb_vm_env_prev_env(env));
+ gc_mark(objspace, (VALUE)rb_vm_env_prev_env(env));
gc_mark(objspace, (VALUE)env->iseq);
}
return;
@@ -7867,10 +7867,10 @@ gc_ref_update_imemo(rb_objspace_t *objspace, VALUE obj)
{
rb_env_t *env = (rb_env_t *)obj;
TYPED_UPDATE_IF_MOVED(objspace, rb_iseq_t *, env->iseq);
+ UPDATE_IF_MOVED(objspace, env->ep[VM_ENV_DATA_INDEX_ENV]);
gc_update_values(objspace, (long)env->env_size, (VALUE *)env->env);
}
break;
- break;
case imemo_cref:
UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.cref.klass);
TYPED_UPDATE_IF_MOVED(objspace, struct rb_cref_struct *, RANY(obj)->as.imemo.cref.next);