]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 10 Feb 2025 20:48:24 +0000 (21:48 +0100)
committerGitHub <noreply@github.com>
Mon, 10 Feb 2025 20:48:24 +0000 (20:48 +0000)
(cherry picked from commit 47d2cb8eb7595df5940225867dbb66b6dd59413a)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Objects/object.c

index a80d20c182ae0bc4ec826159c78627b512f76596..c0ce4291eb73354059472653a834af61644c11f7 100644 (file)
@@ -1692,7 +1692,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
             }
         }
     }