From b714963eda575e35d45d54b04715b2315c324d8f Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 8 Dec 2024 18:59:16 +0900 Subject: [PATCH] fix --- Objects/typeobject.c | 11 +++-------- Programs/test_frozenmain.h | 14 +++++++------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 5d61d0d08442ce..aeaeed1a57322c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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; } @@ -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 * diff --git a/Programs/test_frozenmain.h b/Programs/test_frozenmain.h index c936622c020e3c..d82decbeca39c1 100644 --- a/Programs/test_frozenmain.h +++ b/Programs/test_frozenmain.h @@ -12,26 +12,26 @@ unsigned char M_test_frozenmain[] = { 0,0,111,6,88,2,31,0,79,5,88,6,12,0,79,6, 88,5,88,6,2,0,0,0,12,0,47,4,49,1,0,0, 0,0,0,0,29,0,72,22,0,0,9,0,29,0,79,0, - 33,0,41,7,78,122,18,70,114,111,122,101,110,32,72,101, - 108,108,111,32,87,111,114,108,100,122,8,115,121,115,46,97, + 33,0,41,7,78,218,18,70,114,111,122,101,110,32,72,101, + 108,108,111,32,87,111,114,108,100,218,8,115,121,115,46,97, 114,103,118,218,6,99,111,110,102,105,103,41,5,218,12,112, 114,111,103,114,97,109,95,110,97,109,101,218,10,101,120,101, 99,117,116,97,98,108,101,218,15,117,115,101,95,101,110,118, 105,114,111,110,109,101,110,116,218,17,99,111,110,102,105,103, 117,114,101,95,99,95,115,116,100,105,111,218,14,98,117,102, - 102,101,114,101,100,95,115,116,100,105,111,122,7,99,111,110, - 102,105,103,32,122,2,58,32,41,7,218,3,115,121,115,218, + 102,101,114,101,100,95,115,116,100,105,111,218,7,99,111,110, + 102,105,103,32,218,2,58,32,41,7,218,3,115,121,115,218, 17,95,116,101,115,116,105,110,116,101,114,110,97,108,99,97, 112,105,218,5,112,114,105,110,116,218,4,97,114,103,118,218, - 11,103,101,116,95,99,111,110,102,105,103,115,114,2,0,0, + 11,103,101,116,95,99,111,110,102,105,103,115,114,4,0,0, 0,218,3,107,101,121,169,0,243,0,0,0,0,218,18,116, 101,115,116,95,102,114,111,122,101,110,109,97,105,110,46,112, - 121,218,8,60,109,111,100,117,108,101,62,114,17,0,0,0, + 121,218,8,60,109,111,100,117,108,101,62,114,21,0,0,0, 1,0,0,0,115,94,0,0,0,240,3,1,1,1,243,8, 0,1,11,219,0,24,225,0,5,208,6,26,212,0,27,217, 0,5,128,106,144,35,151,40,145,40,212,0,27,216,9,26, 215,9,38,210,9,38,211,9,40,168,24,209,9,50,128,6, 243,2,6,12,2,128,67,241,14,0,5,10,136,71,144,67, 144,53,152,2,152,54,160,35,153,59,152,45,208,10,40,214, - 4,41,243,15,6,12,2,114,15,0,0,0, + 4,41,243,15,6,12,2,114,19,0,0,0, };