diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-12-26 13:08:06 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-26 13:08:06 +0000 |
commit | 81b7ecc5cb78cad901a9a85e46ecba109cc6ee7d (patch) | |
tree | bb1c6ab4600ec9a4bdfff656f5918b125d043ced | |
parent | 465de3a57b815f1188c707e7c083950c81652536 (diff) | |
download | vim-git-81b7ecc5cb78cad901a9a85e46ecba109cc6ee7d.tar.gz |
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.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/hashtab.c b/src/hashtab.c index dc4ef8888..8c25c818b 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 fdaffe395..eb362a3de 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, |