changeset 12812:381e67ccf02c v8.0.1283

patch 8.0.1283: test 86 fails under ASAN commit https://github.com/vim/vim/commit/9ed7d34af303190bb222624157e0c6cd78b7d120 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 9 22:10:33 2017 +0100 patch 8.0.1283: test 86 fails under ASAN Problem: Test 86 fails under ASAN. Solution: Fix that an item was added to a dictionary twice.
author Christian Brabandt <cb@256bit.org>
date Thu, 09 Nov 2017 22:15:05 +0100
parents 4850b23f928c
children f1aaf8757efe
files src/if_py_both.h src/version.c
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1996,6 +1996,7 @@ DictionaryUpdate(DictionaryObject *self,
 		PyObject	*todecref;
 		char_u		*key;
 		dictitem_T	*di;
+		hashitem_T	*hi;
 
 		if (!(fast = PySequence_Fast(item, "")))
 		{
@@ -2052,7 +2053,8 @@ DictionaryUpdate(DictionaryObject *self,
 
 		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);
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1283,
+/**/
     1282,
 /**/
     1281,