From bd26d8bad7816ca059f9d6b9502cc3fc061bf35d Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 21 Apr 2020 21:38:24 -0400 Subject: [PATCH] don't swap iterators when swapping DB contents Former-commit-id: 4971518d42218a63cf86919e91af54462f6dc8c0 --- src/dict.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dict.cpp b/src/dict.cpp index 7c2a5cd13..fe495dc7b 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -186,11 +186,15 @@ int dictMerge(dict *dst, dict *src) if (dictSize(dst) == 0) { std::swap(*dst, *src); + std::swap(dst->iterators, src->iterators); return DICT_OK; } if (dictSize(src) > dictSize(dst)) + { std::swap(*dst, *src); + std::swap(dst->iterators, src->iterators); + } if (!dictIsRehashing(dst) && !dictIsRehashing(src)) {