]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128759: fix data race in `type_modified_unlocked` (#128764)
authorsobolevn <mail@sobolevn.me>
Mon, 13 Jan 2025 07:40:52 +0000 (10:40 +0300)
committerGitHub <noreply@github.com>
Mon, 13 Jan 2025 07:40:52 +0000 (07:40 +0000)
Objects/typeobject.c

index 680846f1c0b865c1067f14507683a37fdbf3351b..0f5ebc6f90773d8f80856f143ac9084ca16a3297 100644 (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.