Skip to content

Commit b5cc4cf

Browse files
wrongnullsrinivasreddy
authored andcommitted
pythongh-128100: Use atomic dictionary load in _PyObject_GenericGetAttrWithDict (pythonGH-128297)
1 parent 378d062 commit b5cc4cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/object.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
17171717
else {
17181718
PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
17191719
if (dictptr) {
1720+
#ifdef Py_GIL_DISABLED
1721+
dict = _Py_atomic_load_ptr_acquire(dictptr);
1722+
#else
17201723
dict = *dictptr;
1724+
#endif
17211725
}
17221726
}
17231727
}

0 commit comments

Comments
 (0)