File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1010,7 +1010,7 @@ set_version_unlocked(PyTypeObject *tp, unsigned int version)
10101010 _Py_atomic_add_uint16 (& tp -> tp_versions_used , 1 );
10111011 }
10121012#endif
1013- FT_ATOMIC_STORE_UINT32_RELAXED (tp -> tp_version_tag , version );
1013+ FT_ATOMIC_STORE_UINT_RELAXED (tp -> tp_version_tag , version );
10141014#ifndef Py_GIL_DISABLED
10151015 if (version != 0 ) {
10161016 PyTypeObject * * slot =
@@ -1039,7 +1039,8 @@ type_modified_unlocked(PyTypeObject *type)
10391039 We don't assign new version tags eagerly, but only as
10401040 needed.
10411041 */
1042- if (FT_ATOMIC_LOAD_UINT_RELAXED (type -> tp_version_tag ) == 0 ) {
1042+ ASSERT_TYPE_LOCK_HELD ();
1043+ if (type -> tp_version_tag == 0 ) {
10431044 return ;
10441045 }
10451046 // Cannot modify static builtin types.
@@ -1094,7 +1095,7 @@ void
10941095PyType_Modified (PyTypeObject * type )
10951096{
10961097 // Quick check without the lock held
1097- if (type -> tp_version_tag == 0 ) {
1098+ if (FT_ATOMIC_LOAD_UINT_RELAXED ( type -> tp_version_tag ) == 0 ) {
10981099 return ;
10991100 }
11001101
You can’t perform that action at this time.
0 commit comments