diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-09 22:10:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-09 22:10:33 +0100 |
commit | 9ed7d34af303190bb222624157e0c6cd78b7d120 (patch) | |
tree | 5e96e6e7587a075a9558a2c9065375e1e4a7ac7b /src/if_py_both.h | |
parent | cef7322d8a902b4655ed861489c4e798672074f0 (diff) | |
download | vim-git-9ed7d34af303190bb222624157e0c6cd78b7d120.tar.gz |
patch 8.0.1283: test 86 fails under ASANv8.0.1283
Problem: Test 86 fails under ASAN.
Solution: Fix that an item was added to a dictionary twice.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 180196726..3380142d1 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1996,6 +1996,7 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs) PyObject *todecref; char_u *key; dictitem_T *di; + hashitem_T *hi; if (!(fast = PySequence_Fast(item, ""))) { @@ -2052,7 +2053,8 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs) Py_DECREF(fast); - if (dict_add(dict, di) == FAIL) + hi = hash_find(&dict->dv_hashtab, di->di_key); + if (!HASHITEM_EMPTY(hi) || dict_add(dict, di) == FAIL) { RAISE_KEY_ADD_FAIL(di->di_key); Py_DECREF(iterator); |