Skip to content

Commit 9c780ad

Browse files
authored
Update Include/cpython/object.h
1 parent 937aa63 commit 9c780ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/cpython/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int m
495495
do { \
496496
PyThreadState *tstate = PyThreadState_Get(); \
497497
/* TODO(picnixz): remove '(destructor)' cast to detect runtime UBs */ \
498-
if (tstate->c_recursion_remaining <= Py_TRASHCAN_HEADROOM && Py_TYPE(op)->tp_dealloc == (destructor)dealloc) { \
498+
if (_Py_ReachedRecursionLimitWithMargin(tstate, 2) && Py_TYPE(op)->tp_dealloc == (destructor)dealloc) { \
499499
_PyTrash_thread_deposit_object(tstate, (PyObject *)op); \
500500
break; \
501501
}

0 commit comments

Comments
 (0)