Fix bug for removed weak references

rb_darray_foreach gives a pointer to the entry, so we need to deference
it to read the value.
This commit is contained in:
Peter Zhu 2023-10-27 11:00:12 -04:00
parent 26a05c4217
commit 7979c009a7

2
gc.c
View File

@ -8281,7 +8281,7 @@ gc_update_weak_references(rb_objspace_t *objspace)
size_t retained_weak_references_count = 0;
VALUE **ptr_ptr;
rb_darray_foreach(objspace->weak_references, i, ptr_ptr) {
if (!ptr_ptr) continue;
if (!*ptr_ptr) continue;
VALUE obj = **ptr_ptr;