0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3650: Vim9: for loop variable can be a list member

Problem:    Vim9: for loop variable can be a list member.
Solution:   Check for valid variable name. (closes #9179)
This commit is contained in:
Bram Moolenaar
2021-11-22 20:10:18 +00:00
parent 7a53f29c03
commit 3b3755fe19
7 changed files with 38 additions and 9 deletions

View File

@@ -1128,7 +1128,7 @@ get_lval(
wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
&& rettv->v_type == VAR_FUNC
&& var_wrong_func_name(key, lp->ll_di == NULL))
|| !valid_varname(key, TRUE);
|| !valid_varname(key, -1, TRUE);
if (len != -1)
key[len] = prevval;
if (wrong)