mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-132643: use atomic load for dict in specializer (#132653)
This commit is contained in:
parent
80295a8f9b
commit
f3d877a27a
1 changed files with 2 additions and 1 deletions
|
@ -1641,7 +1641,8 @@ specialize_attr_loadclassattr(PyObject *owner, _Py_CODEUNIT *instr,
|
|||
specialize(instr, is_method ? LOAD_ATTR_METHOD_NO_DICT : LOAD_ATTR_NONDESCRIPTOR_NO_DICT);
|
||||
}
|
||||
else if (is_method) {
|
||||
PyObject *dict = *(PyObject **) ((char *)owner + dictoffset);
|
||||
PyObject **addr = (PyObject **)((char *)owner + dictoffset);
|
||||
PyObject *dict = FT_ATOMIC_LOAD_PTR_ACQUIRE(*addr);
|
||||
if (dict) {
|
||||
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_NOT_MANAGED_DICT);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue