summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-07-16 06:50:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-07-16 06:50:14 (GMT)
commita3626bc5bddf9bf43f33060f4ea1a99f25e0c7f1 (patch)
tree269c45ad9cba4708570ab9596331bbd91e4fb7e3 /Objects
parentced770da07f9dbd7cc3afd09c2488c60faefe73c (diff)
downloadcpython-a3626bc5bddf9bf43f33060f4ea1a99f25e0c7f1.zip
cpython-a3626bc5bddf9bf43f33060f4ea1a99f25e0c7f1.tar.gz
cpython-a3626bc5bddf9bf43f33060f4ea1a99f25e0c7f1.tar.bz2
Issue #24583: Fix crash when set is mutated while being updated.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index d962c1e..704d7e2 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -600,7 +600,8 @@ set_merge(PySetObject *so, PyObject *otherset)
}
/* We can't assure there are no duplicates, so do normal insertions */
- for (i = 0; i <= other->mask; i++, other_entry++) {
+ for (i = 0; i <= other->mask; i++) {
+ other_entry = &other->table[i];
key = other_entry->key;
if (key != NULL && key != dummy) {
Py_INCREF(key);