mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
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:
parent
26a05c4217
commit
7979c009a7
1 changed files with 1 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -8281,7 +8281,7 @@ gc_update_weak_references(rb_objspace_t *objspace)
|
||||||
size_t retained_weak_references_count = 0;
|
size_t retained_weak_references_count = 0;
|
||||||
VALUE **ptr_ptr;
|
VALUE **ptr_ptr;
|
||||||
rb_darray_foreach(objspace->weak_references, i, ptr_ptr) {
|
rb_darray_foreach(objspace->weak_references, i, ptr_ptr) {
|
||||||
if (!ptr_ptr) continue;
|
if (!*ptr_ptr) continue;
|
||||||
|
|
||||||
VALUE obj = **ptr_ptr;
|
VALUE obj = **ptr_ptr;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue