Skip to content

Commit f416afe

Browse files
committed
fix reachability of managed object
1 parent c56daf2 commit f416afe

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.cext/src/gcmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
771771
gc_list_append(gc, reachable);
772772
gc_set_refs(gc, gc_refs_reset);
773773
}
774-
else if (gc_refs == 0) {
774+
else if (gc_refs == 0 || (gc_refs == MANAGED_REFCNT && is_managed(gc))) {
775775
/* This is in move_unreachable's 'young' list, but
776776
* the traversal hasn't yet gotten to it. All
777777
* we need to do is tell move_unreachable that it's
@@ -881,7 +881,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable,
881881
assert (PyTruffle_PythonGC());
882882
/* Move gc to weak_candidates *AND* set NEXT_MASK_UNREACHABLE.
883883
* However, since we clear PREV_MASK_COLLECTING, it won't be
884-
* moved back to 'young' by 'vsit_reachable'.
884+
* moved back to 'young' by 'visit_reachable'.
885885
*/
886886
// gc_list_move(gc, weak_candidates);
887887
gc_list_move_with_mask_unreachable(prev, gc, weak_candidates);

0 commit comments

Comments
 (0)