@@ -4581,12 +4581,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
45814581 DEOPT_IF (self_cls -> tp_version_tag != read_u32 (cache -> type_version ),
45824582 LOAD_METHOD );
45834583 /* Treat index as a signed 16 bit value */
4584- int dictoffset = * (int16_t * )& cache -> dict_offset ;
4584+ int dictoffset = self_cls -> tp_dictoffset ;
4585+ assert (dictoffset > 0 );
45854586 PyDictObject * * dictptr = (PyDictObject * * )(((char * )self )+ dictoffset );
4586- assert (
4587- dictoffset == MANAGED_DICT_OFFSET ||
4588- (dictoffset == self_cls -> tp_dictoffset && dictoffset > 0 )
4589- );
45904587 PyDictObject * dict = * dictptr ;
45914588 DEOPT_IF (dict == NULL , LOAD_METHOD );
45924589 DEOPT_IF (dict -> ma_keys -> dk_version != read_u32 (cache -> keys_version ),
@@ -4628,9 +4625,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
46284625 _PyLoadMethodCache * cache = (_PyLoadMethodCache * )next_instr ;
46294626 uint32_t type_version = read_u32 (cache -> type_version );
46304627 DEOPT_IF (self_cls -> tp_version_tag != type_version , LOAD_METHOD );
4631- int dictoffset = cache -> dict_offset ;
4628+ int dictoffset = self_cls -> tp_dictoffset ;
4629+ assert (dictoffset > 0 );
46324630 PyObject * dict = * (PyObject * * )((char * )self + dictoffset );
4633- assert (dictoffset == self_cls -> tp_dictoffset && dictoffset > 0 );
46344631 /* This object has a __dict__, just not yet created */
46354632 DEOPT_IF (dict != NULL , LOAD_METHOD );
46364633 STAT_INC (LOAD_METHOD , hit );
0 commit comments