Skip to content

Commit 9338eea

Browse files
committed
Fix _Py_RefcntAdd
1 parent e24771b commit 9338eea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Include/internal/pycore_object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ extern void _Py_DecRefTotal(PyInterpreterState *);
5858
// Increment reference count by n
5959
static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n)
6060
{
61+
if (_Py_IsImmortal(op)) {
62+
return;
63+
}
6164
#ifdef Py_REF_DEBUG
6265
_Py_AddRefTotal(_PyInterpreterState_GET(), n);
6366
#endif

0 commit comments

Comments
 (0)