Skip to content

Commit 3a3fa9d

Browse files
Fix for disabled GIL
1 parent b6e467e commit 3a3fa9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ PyJitRef_Borrow(JitOptRef ref)
258258
return (JitOptRef){ .bits = ref.bits | Py_TAG_REFCNT };
259259
}
260260

261-
static const JitOptRef PyJitRef_NULL = (JitOptRef){.bits = PyStackRef_NULL.bits};
261+
#ifndef Py_GIL_DISABLED
262+
static const JitOptRef PyJitRef_NULL = (JitOptRef){.bits = PyStackRef_NULL_BITS};
263+
#else
264+
static const JitOptRef PyJitRef_NULL = (JitOptRef){.bits = Py_TAG_DEFERRED};
265+
#endif
262266

263267
static inline bool
264268
PyJitRef_IsNull(JitOptRef ref)

0 commit comments

Comments
 (0)