Skip to content

Commit 67af96c

Browse files
authored
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.
1 parent fc07f86 commit 67af96c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: Include/refcount.h

+6
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ static inline void _Py_DECREF_MORTAL_SPECIALIZED(const char *filename, int linen
416416
_Py_DECREF_DecRefTotal();
417417
}
418418
if (--op->ob_refcnt == 0) {
419+
#ifdef Py_TRACE_REFS
420+
_Py_ForgetReference(op);
421+
#endif
419422
destruct(op);
420423
}
421424
}
@@ -460,6 +463,9 @@ static inline void Py_DECREF_MORTAL_SPECIALIZED(PyObject *op, destructor destruc
460463
assert(!_Py_IsStaticImmortal(op));
461464
_Py_DECREF_STAT_INC();
462465
if (--op->ob_refcnt == 0) {
466+
#ifdef Py_TRACE_REFS
467+
_Py_ForgetReference(op);
468+
#endif
463469
destruct(op);
464470
}
465471
}

0 commit comments

Comments
 (0)