Skip to content

Commit 9ed7d34

Browse files
committed
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.
1 parent cef7322 commit 9ed7d34

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/if_py_both.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,6 +1996,7 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs)
19961996
PyObject *todecref;
19971997
char_u *key;
19981998
dictitem_T *di;
1999+
hashitem_T *hi;
19992000

20002001
if (!(fast = PySequence_Fast(item, "")))
20012002
{
@@ -2052,7 +2053,8 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs)
20522053

20532054
Py_DECREF(fast);
20542055

2055-
if (dict_add(dict, di) == FAIL)
2056+
hi = hash_find(&dict->dv_hashtab, di->di_key);
2057+
if (!HASHITEM_EMPTY(hi) || dict_add(dict, di) == FAIL)
20562058
{
20572059
RAISE_KEY_ADD_FAIL(di->di_key);
20582060
Py_DECREF(iterator);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1283,
764766
/**/
765767
1282,
766768
/**/

0 commit comments

Comments
 (0)