summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-10-27 11:00:12 -0400
committerPeter Zhu <[email protected]>2023-10-27 11:00:12 -0400
commit7979c009a762d9b447f7ef286af2d314b7c11a6c (patch)
treec6692ee497288df93f16c8f4c0438035102b0d1f /gc.c
parent26a05c42173f0f6ad188a28c3ea508b18b376d6b (diff)
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.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index fce9202d9f..6f13ff9284 100644
--- a/gc.c
+++ b/gc.c
@@ -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;