Error if deleting a nonexistent obj from geniv

I don't think this ever happened, but we should raise the same error
we'd raise on lookup
This commit is contained in:
John Hawthorn 2025-11-26 14:37:30 -08:00
parent 5bef7577b3
commit a60cd8787c
Notes: git 2025-11-27 00:14:08 +00:00

View File

@ -1317,7 +1317,9 @@ rb_free_generic_ivar(VALUE obj)
ec->gen_fields_cache.fields_obj = Qundef;
}
RB_VM_LOCKING() {
st_delete(generic_fields_tbl_no_ractor_check(), &key, &value);
if (!st_delete(generic_fields_tbl_no_ractor_check(), &key, &value)) {
rb_bug("Object is missing entry in generic_fields_tbl");
}
}
}
}