gh-117657: Fix data race in dict_dict_merge (gh-129755)

Found while running `test_load_attr_module` from `test_opcache` under TSan.
This commit is contained in:
Sam Gross 2025-02-07 09:44:24 -05:00 committed by GitHub
parent 175844713a
commit 34379d0a59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3793,7 +3793,7 @@ dict_dict_merge(PyInterpreterState *interp, PyDictObject *mp, PyDictObject *othe
ensure_shared_on_resize(mp);
dictkeys_decref(interp, mp->ma_keys, IS_DICT_SHARED(mp));
mp->ma_keys = keys;
set_keys(mp, keys);
STORE_USED(mp, other->ma_used);
ASSERT_CONSISTENT(mp);