]> granicus.if.org Git - vim/commitdiff
patch 9.0.1099: trying to resize a hashtab may cause a problem v9.0.1099
authorBram Moolenaar <Bram@vim.org>
Mon, 26 Dec 2022 13:08:06 +0000 (13:08 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 26 Dec 2022 13:08:06 +0000 (13:08 +0000)
Problem:    Trying to resize a hashtab may cause a problem.
Solution:   Do not try to resize a hashtab before adding an item.

src/hashtab.c
src/version.c

index dc4ef8888b5a7486188fff39365e37b6ceeb1bbf..8c25c818b2f610f82bc5a338242fde7ff9843387 100644 (file)
@@ -249,7 +249,7 @@ hash_add_item(
     hash_T     hash)
 {
     // If resizing failed before and it fails again we can't add an item.
-    if ((ht->ht_flags & HTFLAGS_ERROR) && hash_may_resize(ht, 0) == FAIL)
+    if (ht->ht_flags & HTFLAGS_ERROR)
        return FAIL;
 
     ++ht->ht_used;
index fdaffe395f2870efaef252f7eddabec17bc11cf8..eb362a3de1b22be1db14c3b4e454c1dde1d494fd 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1099,
 /**/
     1098,
 /**/