diff options
author | Mark Shannon <mark@hotpy.org> | 2021-08-02 13:54:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-02 13:54:23 (GMT) |
commit | e06ae75e16dbf46b6626b6a41b62391ea1fdb319 (patch) | |
tree | 1d4af7306909cd560644a16786b2177d86ebc3c4 /Objects | |
parent | 626d397cc1612ea5eef153dd910834c2ee00ddbd (diff) | |
download | cpython-e06ae75e16dbf46b6626b6a41b62391ea1fdb319.zip cpython-e06ae75e16dbf46b6626b6a41b62391ea1fdb319.tar.gz cpython-e06ae75e16dbf46b6626b6a41b62391ea1fdb319.tar.bz2 |
bpo-44206: Make sure that dict-keys's version is set to zero when value is popped (GH-27542)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 7f1d38d..5fb9d01 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1798,6 +1798,7 @@ _PyDict_Pop_KnownHash(PyObject *dict, PyObject *key, Py_hash_t hash, PyObject *d assert(old_value != NULL); mp->ma_used--; mp->ma_version_tag = DICT_NEXT_VERSION(); + mp->ma_keys->dk_version = 0; dictkeys_set_index(mp->ma_keys, hashpos, DKIX_DUMMY); ep = &DK_ENTRIES(mp->ma_keys)[ix]; mp->ma_keys->dk_version = 0; |