Skip to content

Commit 8a7146c

Browse files
[3.13] gh-117657: Fix data race in dict_dict_merge (gh-129755) (gh-129808)
Found while running `test_load_attr_module` from `test_opcache` under TSan. (cherry picked from commit 34379d0) Co-authored-by: Sam Gross <[email protected]>
1 parent aae0a1f commit 8a7146c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/dictobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3713,7 +3713,7 @@ dict_dict_merge(PyInterpreterState *interp, PyDictObject *mp, PyDictObject *othe
37133713

37143714
ensure_shared_on_resize(mp);
37153715
dictkeys_decref(interp, mp->ma_keys, IS_DICT_SHARED(mp));
3716-
mp->ma_keys = keys;
3716+
set_keys(mp, keys);
37173717
STORE_USED(mp, other->ma_used);
37183718
mp->ma_version_tag = new_version;
37193719
ASSERT_CONSISTENT(mp);

0 commit comments

Comments
 (0)