Patch 9.0.1611 Problem: v:maxcol can be changed in a :for loop. Solution: Check for read-only loop variable. (closes #12470) Files: src/evalvars.c, src/testdir/test_eval_stuff.vim
*** ../vim-9.0.1610/src/evalvars.c 2023-05-24 21:02:20.485162125 +0100 --- src/evalvars.c 2023-06-05 19:25:11.236071546 +0100 *************** *** 3842,3848 **** } if ((flags & ASSIGN_FOR_LOOP) == 0 ! && var_check_permission(di, name) == FAIL) goto failed; } else --- 3842,3849 ---- } if ((flags & ASSIGN_FOR_LOOP) == 0 ! ? var_check_permission(di, name) == FAIL ! : var_check_ro(di->di_flags, name, FALSE)) goto failed; } else *** ../vim-9.0.1610/src/testdir/test_eval_stuff.vim 2022-09-21 21:59:58.273433517 +0100 --- src/testdir/test_eval_stuff.vim 2023-06-05 19:27:51.141337993 +0100 *************** *** 126,131 **** --- 126,132 ---- call assert_fails("for x in 99", 'E1098:') call assert_fails("for x in function('winnr')", 'E1098:') call assert_fails("for x in {'a': 9}", 'E1098:') + call assert_fails("for v:maxcol in range(1)", 'E46:') if 0 /1/5/2/s/\n *** ../vim-9.0.1610/src/version.c 2023-06-05 18:41:11.761624543 +0100 --- src/version.c 2023-06-05 19:45:40.516871709 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1611, /**/ -- "Computers in the future may weigh no more than 1.5 tons." Popular Mechanics, 1949 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20230605184643.A9C471C0542%40moolenaar.net.