diff options
| author | John Hawthorn <john@hawthorn.email> | 2025-11-26 14:37:30 -0800 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-11-26 16:13:38 -0800 |
| commit | a60cd8787cb65a6077f609652f6042143d81b227 (patch) | |
| tree | 6a9cc56296d001854f3590c75dd304291ce2eae1 | |
| parent | 5bef7577b3b336a709935dd39e69abcf397c4684 (diff) | |
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
| -rw-r--r-- | variable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/variable.c b/variable.c index f7ee561220..d4c5d91e25 100644 --- a/variable.c +++ b/variable.c @@ -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"); + } } } } |
