]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-128759: Fix accesses to `tp_version_tag`. (GH-129750) (GH-130042)
authorSam Gross <colesbury@gmail.com>
Wed, 12 Feb 2025 15:43:25 +0000 (10:43 -0500)
committerGitHub <noreply@github.com>
Wed, 12 Feb 2025 15:43:25 +0000 (10:43 -0500)
commit2fbc9861c3b1325095019b3df6f3b5b0a1235f1f
tree26c9a1b03cdeebbe7fac50162da702d66529e76c
parent4cb251d06ffef2b4569fa2d08c0561525a6d01d6
[3.13] gh-128759: Fix accesses to `tp_version_tag`. (GH-129750) (GH-130042)

We should use a relaxed atomic load in the free threading build in
`PyType_Modified()` because that's called without the type lock held.
It's not necessary to use atomics in `type_modified_unlocked()`.

We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the
`UINT32` variant because `tp_version_tag` is declared as `unsigned int`.
(cherry picked from commit 57f45ee2d8ee23c2a1d1daba4095a5a044169419)
Include/internal/pycore_pyatomic_ft_wrappers.h
Objects/typeobject.c