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
ko1 committed Jul 28, 2023
1 parent bcf823f commit d0ee586
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10131,15 +10131,12 @@ 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_) {
else if (cc->cme_) { // cc->cme_ is available if cc->klass is given
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 d0ee586

Please sign in to comment.