Skip to content
Prev Previous commit
Next Next commit
fix
  • Loading branch information
corona10 committed Dec 8, 2024
commit b714963eda575e35d45d54b04715b2315c324d8f
11 changes: 3 additions & 8 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5695,7 +5695,7 @@ _PyType_CacheInitForSpecialization(PyHeapTypeObject *type, PyObject *init,
int
_PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
Comment thread
corona10 marked this conversation as resolved.
Outdated
{
int can_cache = 0;
int ret = 0;
if (!type) {
return -1;
}
Expand All @@ -5706,19 +5706,14 @@ _PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
PyFunctionObject *func = (PyFunctionObject *)descriptor;
uint32_t version = _PyFunction_GetVersionForCurrentState(func);
if (!_PyFunction_IsVersionValid(version)) {
Comment thread
corona10 marked this conversation as resolved.
Outdated
can_cache = -1;
ret = -1;
goto end;
}
#ifdef Py_GIL_DISABLED
can_cache = _PyObject_HasDeferredRefcount(descriptor);
#else
can_cache = 0;
#endif
FT_ATOMIC_STORE_PTR_RELEASE(ht->_spec_cache.getitem, descriptor);
FT_ATOMIC_STORE_UINT32_RELAXED(ht->_spec_cache.getitem_version, version);
end:
END_TYPE_LOCK();
return can_cache;
return ret;
}

PyObject *
Expand Down
14 changes: 7 additions & 7 deletions Programs/test_frozenmain.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.