Don't mark empty singleton cc's

These cc's aren't managed by the garbage collector so we shouldn't try
to mark and move them.
This commit is contained in:
eileencodes 2024-04-12 09:18:47 -04:00 committed by Aaron Patterson
parent 64d0817ea9
commit 6443d690ae

4
iseq.c
View File

@ -292,6 +292,10 @@ static bool
cc_is_active(const struct rb_callcache *cc, bool reference_updating)
{
if (cc) {
if (cc == rb_vm_empty_cc() || rb_vm_empty_cc_for_super()) {
return false;
}
if (reference_updating) {
cc = (const struct rb_callcache *)rb_gc_location((VALUE)cc);
}