mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)
This commit is contained in:
parent
fa86a77589
commit
ce871fdc3a
3 changed files with 28 additions and 16 deletions
|
|
@ -58,6 +58,9 @@ extern void _Py_DecRefTotal(PyInterpreterState *);
|
|||
// Increment reference count by n
|
||||
static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n)
|
||||
{
|
||||
if (_Py_IsImmortal(op)) {
|
||||
return;
|
||||
}
|
||||
#ifdef Py_REF_DEBUG
|
||||
_Py_AddRefTotal(_PyInterpreterState_GET(), n);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue