]> granicus.if.org Git - vim/commitdiff
patch 8.0.1283: test 86 fails under ASAN v8.0.1283
authorBram Moolenaar <Bram@vim.org>
Thu, 9 Nov 2017 21:10:33 +0000 (22:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 9 Nov 2017 21:10:33 +0000 (22:10 +0100)
Problem:    Test 86 fails under ASAN.
Solution:   Fix that an item was added to a dictionary twice.

src/if_py_both.h
src/version.c

index 1801967268ac7e9eed2cdd0b77653a84c0a795b8..3380142d1e803d7eca7d4b077e64d04ccd1a84db 100644 (file)
@@ -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);
index b2a3ce40ac01111729f49d4f9f074ddd82c40bce..c74f062516acfe8e659ae74a8e20710b7d47109c 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1283,
 /**/
     1282,
 /**/