0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.0.1099: trying to resize a hashtab may cause a problem

Problem:    Trying to resize a hashtab may cause a problem.
Solution:   Do not try to resize a hashtab before adding an item.
This commit is contained in:
Bram Moolenaar 2022-12-26 13:08:06 +00:00
parent 465de3a57b
commit 81b7ecc5cb
2 changed files with 3 additions and 1 deletions

View File

@ -249,7 +249,7 @@ hash_add_item(
hash_T hash) hash_T hash)
{ {
// If resizing failed before and it fails again we can't add an item. // 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; return FAIL;
++ht->ht_used; ++ht->ht_used;

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1099,
/**/ /**/
1098, 1098,
/**/ /**/