summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-26 13:08:06 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-26 13:08:06 +0000
commit81b7ecc5cb78cad901a9a85e46ecba109cc6ee7d (patch)
treebb1c6ab4600ec9a4bdfff656f5918b125d043ced
parent465de3a57b815f1188c707e7c083950c81652536 (diff)
patch 9.0.1099: trying to resize a hashtab may cause a problemv9.0.1099
Problem: Trying to resize a hashtab may cause a problem. Solution: Do not try to resize a hashtab before adding an item.
-rw-r--r--src/hashtab.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/hashtab.c b/src/hashtab.c
index dc4ef8888b..8c25c818b2 100644
--- a/src/hashtab.c
+++ b/src/hashtab.c
@@ -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;
diff --git a/src/version.c b/src/version.c
index fdaffe395f..eb362a3de1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1099,
+/**/
1098,
/**/
1097,