From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:48:24 +0000 (+0100) Subject: [3.13] gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict... X-Git-Tag: v3.13.3~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=052632279d3d47a5ac28224afbefd09719ebbe93;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297) (GH-129979) (cherry picked from commit 47d2cb8eb7595df5940225867dbb66b6dd59413a) Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> --- diff --git a/Objects/object.c b/Objects/object.c index a80d20c182ae..c0ce4291eb73 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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 } } }