mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
vim-patch:9.2.1731: Vim9: cannot use += to append to empty NULL list
Problem: Vim9: cannot use += to append to empty NULL list.
Solution: Copy the list instead of extending it. (closes vim/vim#6998)
81ed496048
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1519,7 +1519,14 @@ static char *get_lval_subscript(lval_T *lp, char *p, char *name, typval_T *rettv
|
||||
key = (char *)tv_get_string(&var1); // is number or string
|
||||
}
|
||||
lp->ll_list = NULL;
|
||||
|
||||
// a NULL dict is equivalent with an empty dict
|
||||
if (lp->ll_tv->vval.v_dict == NULL) {
|
||||
lp->ll_tv->vval.v_dict = tv_dict_alloc();
|
||||
lp->ll_tv->vval.v_dict->dv_refcount++;
|
||||
}
|
||||
lp->ll_dict = lp->ll_tv->vval.v_dict;
|
||||
|
||||
lp->ll_di = tv_dict_find(lp->ll_dict, key, len);
|
||||
|
||||
// When assigning to a scope dictionary check that a function and
|
||||
|
Reference in New Issue
Block a user