From: sobolevn Date: Mon, 13 Jan 2025 07:40:52 +0000 (+0300) Subject: gh-128759: fix data race in `type_modified_unlocked` (#128764) X-Git-Tag: v3.14.0a4~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e1e78054060ad326f26dd8dbf12adfedbb52883;p=thirdparty%2FPython%2Fcpython.git gh-128759: fix data race in `type_modified_unlocked` (#128764) --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 680846f1c0b8..0f5ebc6f9077 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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.