Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Dec 8, 2024
1 parent bb23e4b commit b714963
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
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)
{
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)) {
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.

0 comments on commit b714963

Please sign in to comment.