@@ -1033,6 +1033,7 @@ specialize_dict_access(
10331033static int
10341034specialize_attr_loadclassattr (PyObject * owner , _Py_CODEUNIT * instr ,
10351035 PyObject * name , PyObject * descr ,
1036+ unsigned int tp_version ,
10361037 DescriptorClassification kind , bool is_method ,
10371038 uint32_t shared_keys_version );
10381039#ifndef Py_GIL_DISABLED
@@ -1105,14 +1106,14 @@ do_specialize_instance_load_attr(PyObject* owner, _Py_CODEUNIT* instr, PyObject*
11051106 return -1 ;
11061107 case METHOD :
11071108 {
1108- FT_UNIMPLEMENTED ();
11091109 if (shadow ) {
1110+ FT_UNIMPLEMENTED ();
11101111 goto try_instance ;
11111112 }
11121113 int oparg = instr -> op .arg ;
11131114 if (oparg & 1 ) {
11141115 if (specialize_attr_loadclassattr (owner , instr , name , descr ,
1115- kind , true,
1116+ tp_version , kind , true,
11161117 shared_keys_version )) {
11171118 return 0 ;
11181119 }
@@ -1242,7 +1243,7 @@ do_specialize_instance_load_attr(PyObject* owner, _Py_CODEUNIT* instr, PyObject*
12421243 }
12431244 if ((instr -> op .arg & 1 ) == 0 ) {
12441245 if (specialize_attr_loadclassattr (owner , instr , name , descr ,
1245- kind , false,
1246+ tp_version , kind , false,
12461247 shared_keys_version )) {
12471248 return 0 ;
12481249 }
@@ -1546,6 +1547,7 @@ specialize_class_load_attr(PyObject *owner, _Py_CODEUNIT *instr,
15461547static int
15471548specialize_attr_loadclassattr (PyObject * owner , _Py_CODEUNIT * instr ,
15481549 PyObject * name , PyObject * descr ,
1550+ unsigned int tp_version ,
15491551 DescriptorClassification kind , bool is_method ,
15501552 uint32_t shared_keys_version )
15511553{
@@ -1622,7 +1624,7 @@ specialize_attr_loadclassattr(PyObject *owner, _Py_CODEUNIT *instr,
16221624 * PyType_Modified usages in typeobject.c). The MCACHE has been
16231625 * working since Python 2.6 and it's battle-tested.
16241626 */
1625- write_u32 (cache -> type_version , owner_cls -> tp_version_tag );
1627+ write_u32 (cache -> type_version , tp_version );
16261628 write_obj (cache -> descr , descr );
16271629 return 1 ;
16281630}
0 commit comments