@@ -316,9 +316,7 @@ PyObject_CallFinalizerFromDealloc(PyObject *self)
316316 _Py_NewReference (self );
317317 self -> ob_refcnt = refcnt ;
318318
319- if (PyType_IS_GC (Py_TYPE (self ))) {
320- assert (_PyGC_REFS (self ) != _PyGC_REFS_UNTRACKED );
321- }
319+ assert (!PyType_IS_GC (Py_TYPE (self )) || _PyObject_GC_IS_TRACKED (self ));
322320 /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
323321 * we need to undo that. */
324322 _Py_DEC_REFTOTAL ;
@@ -2095,7 +2093,7 @@ void
20952093_PyTrash_deposit_object (PyObject * op )
20962094{
20972095 assert (PyObject_IS_GC (op ));
2098- assert (_PyGC_REFS (op ) == _PyGC_REFS_UNTRACKED );
2096+ assert (! _PyObject_GC_IS_TRACKED (op ));
20992097 assert (op -> ob_refcnt == 0 );
21002098 _Py_AS_GC (op )-> gc .gc_prev = (PyGC_Head * )_PyRuntime .gc .trash_delete_later ;
21012099 _PyRuntime .gc .trash_delete_later = op ;
@@ -2107,7 +2105,7 @@ _PyTrash_thread_deposit_object(PyObject *op)
21072105{
21082106 PyThreadState * tstate = PyThreadState_GET ();
21092107 assert (PyObject_IS_GC (op ));
2110- assert (_PyGC_REFS (op ) == _PyGC_REFS_UNTRACKED );
2108+ assert (! _PyObject_GC_IS_TRACKED (op ));
21112109 assert (op -> ob_refcnt == 0 );
21122110 _Py_AS_GC (op )-> gc .gc_prev = (PyGC_Head * ) tstate -> trash_delete_later ;
21132111 tstate -> trash_delete_later = op ;
0 commit comments