GH-133261: Make sure that the GC doesn't untrack objects in trashcan (GH-133431)

This commit is contained in:
Mark Shannon 2025-05-05 13:44:50 +01:00 committed by GitHub
parent 8d5f3cd2ce
commit f554237b8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 6 deletions

View file

@ -493,6 +493,7 @@ update_refs(PyGC_Head *containers)
next = GC_NEXT(gc);
PyObject *op = FROM_GC(gc);
if (_Py_IsImmortal(op)) {
assert(!_Py_IsStaticImmortal(op));
_PyObject_GC_UNTRACK(op);
gc = next;
continue;