summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>2024-12-30 20:38:49 (GMT)
committerGitHub <noreply@github.com>2024-12-30 20:38:49 (GMT)
commit47d2cb8eb7595df5940225867dbb66b6dd59413a (patch)
tree56eea4661785e619f8b63541598c5efe88c41191 /Objects
parentfe4dd07a84ba423179a93ed84bdcc2b4c99b35a9 (diff)
downloadcpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.zip
cpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.tar.gz
cpython-47d2cb8eb7595df5940225867dbb66b6dd59413a.tar.bz2
gh-128100: Use atomic dictionary load in `_PyObject_GenericGetAttrWithDict` (GH-128297)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index d584414..4c30257 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -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
}
}
}