Skip to content

Commit 3c1ef42

Browse files
committed
Revert check for immortality.
1 parent 912ebc1 commit 3c1ef42

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/gc.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,11 @@ update_refs(PyGC_Head *containers)
475475
while (gc != containers) {
476476
next = GC_NEXT(gc);
477477
PyObject *op = FROM_GC(gc);
478-
assert(!_Py_IsImmortal(op));
478+
if (_Py_IsImmortal(op)) {
479+
gc_list_move(gc, &get_gc_state()->permanent_generation.head);
480+
gc = next;
481+
continue;
482+
}
479483
gc_reset_refs(gc, Py_REFCNT(op));
480484
/* Python's cyclic gc should never see an incoming refcount
481485
* of 0: if something decref'ed to 0, it should have been

0 commit comments

Comments
 (0)