comparison src/dict.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 925ffa1eeb08
children 936f77929f16
comparison
equal deleted inserted replaced
26237:83c695dd5355 26238:14b4c778b61e
1100 // Check the key to be valid when adding to any scope. 1100 // Check the key to be valid when adding to any scope.
1101 if (d1->dv_scope == VAR_DEF_SCOPE 1101 if (d1->dv_scope == VAR_DEF_SCOPE
1102 && HI2DI(hi2)->di_tv.v_type == VAR_FUNC 1102 && HI2DI(hi2)->di_tv.v_type == VAR_FUNC
1103 && var_wrong_func_name(hi2->hi_key, di1 == NULL)) 1103 && var_wrong_func_name(hi2->hi_key, di1 == NULL))
1104 break; 1104 break;
1105 if (!valid_varname(hi2->hi_key, TRUE)) 1105 if (!valid_varname(hi2->hi_key, -1, TRUE))
1106 break; 1106 break;
1107 } 1107 }
1108 1108
1109 if (type != NULL 1109 if (type != NULL
1110 && check_typval_arg_type(type, &HI2DI(hi2)->di_tv, 1110 && check_typval_arg_type(type, &HI2DI(hi2)->di_tv,