Skip to content

Commit 65b6dd0

Browse files
Address review comments
1 parent c2416a6 commit 65b6dd0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Objects/funcobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ _PyFunction_ClearCodeByVersion(uint32_t version)
381381
PyFunctionObject *
382382
_PyFunction_LookupByVersion(uint32_t version, PyObject **p_code)
383383
{
384-
#if _Py_TIER2
384+
#ifndef _Py_TIER2
385+
return NULL;
386+
#else
385387
// This function does not need locking/atomics as it can only be
386388
// called from the optimizer, which is currently disabled
387389
// when there are multiple threads.
@@ -402,8 +404,6 @@ _PyFunction_LookupByVersion(uint32_t version, PyObject **p_code)
402404
return slot->func;
403405
}
404406
return NULL;
405-
#else
406-
return NULL;
407407
#endif
408408
}
409409

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,8 @@ set_version_unlocked(PyTypeObject *tp, unsigned int version)
11501150
{
11511151
assert(version == 0 || (tp->tp_versions_used != _Py_ATTR_CACHE_UNUSED));
11521152
#if _Py_TIER2
1153+
ASSERT_TYPE_LOCK_HELD();
11531154
PyInterpreterState *interp = _PyInterpreterState_GET();
1154-
BEGIN_TYPE_LOCK();
11551155
// lookup the old version and set to null
11561156
if (tp->tp_version_tag != 0) {
11571157
PyTypeObject **slot =

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4125,7 +4125,7 @@ _jit_is_enabled_impl(PyObject *module)
41254125
/*[clinic end generated code: output=55865f8de993fe42 input=0524151e857f4f3a]*/
41264126
{
41274127
(void)module;
4128-
return _PyInterpreterState_GET()->jit;
4128+
return FT_ATOMIC_LOAD_UINT8_RELAXED(_PyInterpreterState_GET()->jit);
41294129
}
41304130

41314131
/*[clinic input]

0 commit comments

Comments
 (0)