Skip to content

Commit 6c286b2

Browse files
committed
Do same fix for instance attributes
1 parent 55d5e6d commit 6c286b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7015,7 +7015,7 @@ _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name, PyObject **attr
70157015
// Still no dict, we can read from the values
70167016
assert(values->valid);
70177017
value = values->values[ix];
7018-
*attr = Py_XNewRef(value);
7018+
*attr = _Py_XNewRefWithLock(value);
70197019
success = true;
70207020
}
70217021

@@ -7035,7 +7035,7 @@ _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name, PyObject **attr
70357035

70367036
if (dict->ma_values == values && FT_ATOMIC_LOAD_UINT8(values->valid)) {
70377037
value = _Py_atomic_load_ptr_relaxed(&values->values[ix]);
7038-
*attr = Py_XNewRef(value);
7038+
*attr = _Py_XNewRefWithLock(value);
70397039
success = true;
70407040
} else {
70417041
// Caller needs to lookup from the dictionary

0 commit comments

Comments
 (0)