summaryrefslogtreecommitdiff
path: root/imemo.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-08-07 15:39:45 -0700
committerGitHub <noreply@github.com>2025-08-07 15:39:45 -0700
commitc41c323f1a001ab62c69add4bf01c6a887641f2a (patch)
tree1ce09bd0cc802f308f4db1a13713da4246c5a34f /imemo.c
parentd25eb1eb5c05ac1cadd9cc03ddd37f8eda57d7f1 (diff)
Invalidate CCs when cme is invalidated in marking
* Skip assertion when cc->klass is Qundef * Invalidate CCs when cme is invalidated in marking * Add additional assertions that CC references stay valid Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Diffstat (limited to 'imemo.c')
-rw-r--r--imemo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/imemo.c b/imemo.c
index 2c721ca911..30dae8d583 100644
--- a/imemo.c
+++ b/imemo.c
@@ -372,6 +372,9 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating)
}
}
else {
+ RUBY_ASSERT(RB_TYPE_P(cc->klass, T_CLASS) || RB_TYPE_P(cc->klass, T_ICLASS));
+ RUBY_ASSERT(IMEMO_TYPE_P((VALUE)cc->cme_, imemo_ment));
+
rb_gc_mark_weak((VALUE *)&cc->klass);
if ((vm_cc_super_p(cc) || vm_cc_refinement_p(cc))) {
rb_gc_mark_movable((VALUE)cc->cme_);