summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-25 16:31:51 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-25 16:31:51 +0000
commitef2c325f5e3c437b722bb96bf369ba2a5c541163 (patch)
treedc85f0dc98dce1937b459d8d3882473f25db03c3 /src/if_ruby.c
parentc1cf4c91072f91b6b8dd636627a4ddf6f4b21f16 (diff)
downloadvim-git-ef2c325f5e3c437b722bb96bf369ba2a5c541163.tar.gz
patch 9.0.0949: crash when unletting a variable while listing variablesv9.0.0949
Problem: Crash when unletting a variable while listing variables. Solution: Disallow changing a hashtable while going over the entries. (closes #11435)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index feb1d5009..51cfff13d 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -1799,7 +1799,7 @@ convert_hash2dict(VALUE key, VALUE val, VALUE arg)
if (di == NULL || ruby_convert_to_vim_value(val, &di->di_tv) != OK
|| dict_add(d, di) != OK)
{
- d->dv_hashtab.ht_error = TRUE;
+ d->dv_hashtab.ht_flags |= HTFLAGS_ERROR;
return ST_STOP;
}
return ST_CONTINUE;
@@ -1879,7 +1879,7 @@ ruby_convert_to_vim_value(VALUE val, typval_T *rettv)
return FAIL;
rb_hash_foreach(val, convert_hash2dict, (VALUE)d);
- if (d->dv_hashtab.ht_error)
+ if (d->dv_hashtab.ht_flags & HTFLAGS_ERROR)
{
dict_unref(d);
return FAIL;