Skip to content

Commit

Permalink
do not clear cme but invalidate cc
Browse files Browse the repository at this point in the history
To invalidate a cc, we need to clear cc->klass by `vm_cc_invalidate()`.
I hope this patch fix the CI failures.
  • Loading branch information
Ruby committed Jul 28, 2023
1 parent c330037 commit e113475
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10131,15 +10131,15 @@ gc_ref_update_imemo(rb_objspace_t *objspace, VALUE obj)
if (cc->klass) {
UPDATE_IF_MOVED(objspace, cc->klass);
if (!is_live_object(objspace, cc->klass)) {
*((VALUE *)(&cc->klass)) = (VALUE)0;
vm_cc_invalidate(cc);
}

// cc->cme_ is available if cc->klass is given

if (cc->cme_) {
TYPED_UPDATE_IF_MOVED(objspace, struct rb_callable_method_entry_struct *, cc->cme_);
if (!is_live_object(objspace, (VALUE)cc->cme_)) {
*((struct rb_callable_method_entry_struct **)(&cc->cme_)) = (struct rb_callable_method_entry_struct *)0;
vm_cc_invalidate(cc);
}
}
}
Expand Down

0 comments on commit e113475

Please sign in to comment.