Skip to content

Commit 0526322

Browse files
[3.13] gh-128100: Use atomic dictionary load in _PyObject_GenericGetAttrWithDict (GH-128297) (GH-129979)
(cherry picked from commit 47d2cb8) Co-authored-by: Bogdan Romanyuk <[email protected]>
1 parent a38bacd commit 0526322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/object.c

+4
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
16921692
else {
16931693
PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
16941694
if (dictptr) {
1695+
#ifdef Py_GIL_DISABLED
1696+
dict = _Py_atomic_load_ptr_acquire(dictptr);
1697+
#else
16951698
dict = *dictptr;
1699+
#endif
16961700
}
16971701
}
16981702
}

0 commit comments

Comments
 (0)