From 67af96c61c2bafc5ac578e576af18d01a2c7d152 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Fri, 14 Mar 2025 12:02:09 +0000 Subject: 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. --- Include/refcount.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Include/refcount.h b/Include/refcount.h index ba14bc6..3efb7e5 100644 --- a/Include/refcount.h +++ b/Include/refcount.h @@ -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); } } -- cgit v0.12