mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2760: Vim9: no error for changing a for loop variable
Problem: Vim9: no error for changing a for loop variable. Solution: Make the loop variable read-only. (issue #8102)
This commit is contained in:
@@ -7590,7 +7590,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
|
||||
|
||||
// Reserve a variable to store "var".
|
||||
// TODO: check for type
|
||||
var_lvar = reserve_local(cctx, arg, varlen, FALSE, &t_any);
|
||||
var_lvar = reserve_local(cctx, arg, varlen, TRUE, &t_any);
|
||||
if (var_lvar == NULL)
|
||||
// out of memory or used as an argument
|
||||
goto failed;
|
||||
|
Reference in New Issue
Block a user