]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297)
authorBogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Mon, 30 Dec 2024 20:38:49 +0000 (23:38 +0300)
committerGitHub <noreply@github.com>
Mon, 30 Dec 2024 20:38:49 +0000 (20:38 +0000)
Objects/object.c

index d584414c559b9d36a36aa2e49de5da1044d96b30..4c30257ca26938a3d6d561a5289420b207c42bd2 100644 (file)
@@ -1717,7 +1717,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
         else {
             PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
             if (dictptr) {
+#ifdef Py_GIL_DISABLED
+                dict = _Py_atomic_load_ptr_acquire(dictptr);
+#else
                 dict = *dictptr;
+#endif
             }
         }
     }