https://github.com/python/cpython/commit/052632279d3d47a5ac28224afbefd09719ebbe93
commit: 052632279d3d47a5ac28224afbefd09719ebbe93
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: colesbury <[email protected]>
date: 2025-02-10T20:48:24Z
summary:

[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 <[email protected]>

files:
M Objects/object.c

diff --git a/Objects/object.c b/Objects/object.c
index a80d20c182ae0b..c0ce4291eb7335 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
             }
         }
     }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to