GH-127705: Handle trace refs in specialized decref (GH-131198)

This is missing `_PyReftracerTrack` calls, see gh-131238.
Merging as-is for the 3.14.0a6 release.
This commit is contained in:
Mark Shannon 2025-03-14 12:02:09 +00:00 committed by GitHub
parent fc07f863ee
commit 67af96c61c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -416,6 +416,9 @@ static inline void _Py_DECREF_MORTAL_SPECIALIZED(const char *filename, int linen
_Py_DECREF_DecRefTotal();
}
if (--op->ob_refcnt == 0) {
#ifdef Py_TRACE_REFS
_Py_ForgetReference(op);
#endif
destruct(op);
}
}
@ -460,6 +463,9 @@ static inline void Py_DECREF_MORTAL_SPECIALIZED(PyObject *op, destructor destruc
assert(!_Py_IsStaticImmortal(op));
_Py_DECREF_STAT_INC();
if (--op->ob_refcnt == 0) {
#ifdef Py_TRACE_REFS
_Py_ForgetReference(op);
#endif
destruct(op);
}
}