bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341)

(cherry picked from commit d1c82c5cc7)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2018-04-02 20:22:14 -07:00 committed by GitHub
parent 306559e6ca
commit 9a90826c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Fix ``ma_version_tag`` in dict implementation is uninitialized when copying
from key-sharing dict.

View File

@ -2654,6 +2654,7 @@ PyDict_Copy(PyObject *o)
split_copy->ma_values = newvalues;
split_copy->ma_keys = mp->ma_keys;
split_copy->ma_used = mp->ma_used;
split_copy->ma_version_tag = DICT_NEXT_VERSION();
DK_INCREF(mp->ma_keys);
for (i = 0, n = size; i < n; i++) {
PyObject *value = mp->ma_values[i];