We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2c45c6 commit 477b43cCopy full SHA for 477b43c
Include/internal/pycore_stackref.h
@@ -628,14 +628,14 @@ PyStackRef_DUP(_PyStackRef ref)
628
static inline bool
629
PyStackRef_IsHeapSafe(_PyStackRef ref)
630
{
631
+#ifdef Py_GIL_DISABLED
632
if ((ref.bits & Py_TAG_BITS) != Py_TAG_REFCNT) {
633
return true;
634
}
635
PyObject *obj = BITS_TO_PTR_MASKED(ref);
-#ifdef Py_GIL_DISABLED
636
return obj == NULL || _PyObject_HasDeferredRefcount(obj);
637
#else
638
- return obj == NULL || _Py_IsImmortal(obj);
+ return (ref.bits & Py_TAG_BITS) != Py_TAG_REFCNT || ref.bits == PyStackRef_NULL_BITS || _Py_IsImmortal(BITS_TO_PTR_MASKED(ref));
639
#endif
640
641
0 commit comments