Skip to content

Commit a60cd87

Browse files
committed
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
1 parent 5bef757 commit a60cd87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

variable.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,9 @@ rb_free_generic_ivar(VALUE obj)
13171317
ec->gen_fields_cache.fields_obj = Qundef;
13181318
}
13191319
RB_VM_LOCKING() {
1320-
st_delete(generic_fields_tbl_no_ractor_check(), &key, &value);
1320+
if (!st_delete(generic_fields_tbl_no_ractor_check(), &key, &value)) {
1321+
rb_bug("Object is missing entry in generic_fields_tbl");
1322+
}
13211323
}
13221324
}
13231325
}

0 commit comments

Comments
 (0)