File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -690,10 +690,13 @@ set_opcode(_Py_CODEUNIT *instr, uint8_t opcode)
690690}
691691
692692static inline int
693- set_cache_verison (uint16_t * old_version , uint32_t new_version )
693+ set_cache_version (uint16_t * old_version , uint32_t new_version )
694694{
695695#ifdef Py_GIL_DISABLED
696696 uint16_t old_version_val = _Py_atomic_load_uint16_relaxed (old_version );
697+ if (old_version_val > (uint16_t )new_version ) {
698+ return 0 ;
699+ }
697700 if (!_Py_atomic_compare_exchange_uint16 (old_version , & old_version_val , new_version )) {
698701 return 0 ;
699702 }
@@ -2757,13 +2760,7 @@ _Py_Specialize_ToBool(_PyStackRef value_o, _Py_CODEUNIT *instr)
27572760 unspecialize (instr , SPEC_FAIL_OUT_OF_VERSIONS );
27582761 return ;
27592762 }
2760- #ifdef Py_GIL_DISABLED
2761- if (read_u32 (cache -> version ) > version ) {
2762- unspecialize (instr , SPEC_FAIL_OUT_OF_VERSIONS );
2763- return ;
2764- }
2765- #endif
2766- if (!set_cache_verison (cache -> version , version )) {
2763+ if (!set_cache_version (cache -> version , version )) {
27672764 unspecialize (instr , SPEC_FAIL_OUT_OF_VERSIONS );
27682765 return ;
27692766 }
You can’t perform that action at this time.
0 commit comments