@@ -4581,12 +4581,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
4581
4581
DEOPT_IF (self_cls -> tp_version_tag != read_u32 (cache -> type_version ),
4582
4582
LOAD_METHOD );
4583
4583
/* 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 );
4585
4586
PyDictObject * * dictptr = (PyDictObject * * )(((char * )self )+ dictoffset );
4586
- assert (
4587
- dictoffset == MANAGED_DICT_OFFSET ||
4588
- (dictoffset == self_cls -> tp_dictoffset && dictoffset > 0 )
4589
- );
4590
4587
PyDictObject * dict = * dictptr ;
4591
4588
DEOPT_IF (dict == NULL , LOAD_METHOD );
4592
4589
DEOPT_IF (dict -> ma_keys -> dk_version != read_u32 (cache -> keys_version ),
@@ -4628,9 +4625,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
4628
4625
_PyLoadMethodCache * cache = (_PyLoadMethodCache * )next_instr ;
4629
4626
uint32_t type_version = read_u32 (cache -> type_version );
4630
4627
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 );
4632
4630
PyObject * dict = * (PyObject * * )((char * )self + dictoffset );
4633
- assert (dictoffset == self_cls -> tp_dictoffset && dictoffset > 0 );
4634
4631
/* This object has a __dict__, just not yet created */
4635
4632
DEOPT_IF (dict != NULL , LOAD_METHOD );
4636
4633
STAT_INC (LOAD_METHOD , hit );
0 commit comments