Skip to content

gh-124642: Dictionaries aren't marking objects as weakref'd #124643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do same fix for instance attributes
  • Loading branch information
DinoV committed Sep 27, 2024
commit 6c286b2eabb247f6e451693b1d70f210b651361b
4 changes: 2 additions & 2 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7015,7 +7015,7 @@ _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name, PyObject **attr
// Still no dict, we can read from the values
assert(values->valid);
value = values->values[ix];
*attr = Py_XNewRef(value);
*attr = _Py_XNewRefWithLock(value);
success = true;
}

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

if (dict->ma_values == values && FT_ATOMIC_LOAD_UINT8(values->valid)) {
value = _Py_atomic_load_ptr_relaxed(&values->values[ix]);
*attr = Py_XNewRef(value);
*attr = _Py_XNewRefWithLock(value);
success = true;
} else {
// Caller needs to lookup from the dictionary
Expand Down
Loading