summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2023-06-02 15:26:02 -0400
committernagachika <nagachika@ruby-lang.org>2023-07-01 14:17:30 +0900
commit038913f1e9dd4efdbea4047b3e0a3e15f407dfd2 (patch)
treef746fc9028247ea27dccd3d94901055fcd3fc1de
parent8a3d57971c99680d4baec84553247b9c6ee41080 (diff)
Add missing write barrier
We were missing the write barrier for class_value to cref. This should fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052 Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
-rw-r--r--vm_insnhelper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b7a69232c9..6d0e66fdef 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1512,6 +1512,7 @@ update_classvariable_cache(const rb_iseq_t *iseq, VALUE klass, ID id, const rb_c
RUBY_ASSERT(BUILTIN_TYPE((VALUE)cref) == T_IMEMO && IMEMO_TYPE_P(cref, imemo_cref));
RB_OBJ_WRITTEN(iseq, Qundef, ent->cref);
RB_OBJ_WRITTEN(iseq, Qundef, ent->class_value);
+ RB_OBJ_WRITTEN(ent->class_value, Qundef, ent->cref);
return cvar_value;
}