gh-128759: fix data race in type_modified_unlocked (#128764)

This commit is contained in:
sobolevn 2025-01-13 10:40:52 +03:00 committed by GitHub
parent d0ecbdd838
commit 6e1e780540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1038,7 +1038,7 @@ type_modified_unlocked(PyTypeObject *type)
We don't assign new version tags eagerly, but only as
needed.
*/
if (type->tp_version_tag == 0) {
if (FT_ATOMIC_LOAD_UINT_RELAXED(type->tp_version_tag) == 0) {
return;
}
// Cannot modify static builtin types.