Mercurial > vim
comparison src/eval.c @ 26238:14b4c778b61e v8.2.3650
patch 8.2.3650: Vim9: for loop variable can be a list member
Commit: https://github.com/vim/vim/commit/3b3755fe19e9ded2a1c45f14b2c6fa065bcaf2c6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 22 20:10:18 2021 +0000
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 https://github.com/vim/vim/issues/9179)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 22 Nov 2021 21:15:03 +0100 |
parents | e861c5aaedd8 |
children | 8afd7aa25ab6 |
comparison
equal
deleted
inserted
replaced
26237:83c695dd5355 | 26238:14b4c778b61e |
---|---|
1126 else | 1126 else |
1127 prevval = 0; // avoid compiler warning | 1127 prevval = 0; // avoid compiler warning |
1128 wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE | 1128 wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE |
1129 && rettv->v_type == VAR_FUNC | 1129 && rettv->v_type == VAR_FUNC |
1130 && var_wrong_func_name(key, lp->ll_di == NULL)) | 1130 && var_wrong_func_name(key, lp->ll_di == NULL)) |
1131 || !valid_varname(key, TRUE); | 1131 || !valid_varname(key, -1, TRUE); |
1132 if (len != -1) | 1132 if (len != -1) |
1133 key[len] = prevval; | 1133 key[len] = prevval; |
1134 if (wrong) | 1134 if (wrong) |
1135 { | 1135 { |
1136 clear_tv(&var1); | 1136 clear_tv(&var1); |