Commit d1c82c5c authored by INADA Naoki's avatar INADA Naoki Committed by GitHub

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

parent a68f2f05
Fix ``ma_version_tag`` in dict implementation is uninitialized when copying
from key-sharing dict.
......@@ -2551,6 +2551,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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment