Patch 8.2.2693
Problem: Vim9: locked script variable can be changed.
Solution: Check legacy script variable for being locked. (issue #8031)
Files: src/vim9execute.c, src/testdir/test_vim9_assign.vim
*** ../vim-8.2.2692/src/vim9execute.c 2021-04-02 14:35:11.572258008 +0200
--- src/vim9execute.c 2021-04-02 14:39:23.871717595 +0200
***************
*** 1942,1947 ****
--- 1942,1950 ----
store_var(name, STACK_TV_BOT(0));
else
{
+ SOURCING_LNUM = iptr->isn_lnum;
+ if (var_check_permission(di, name) == FAIL)
+ goto on_error;
clear_tv(&di->di_tv);
di->di_tv = *STACK_TV_BOT(0);
}
*** ../vim-8.2.2692/src/testdir/test_vim9_assign.vim 2021-04-02
14:35:11.572258008 +0200
--- src/testdir/test_vim9_assign.vim 2021-04-02 14:42:29.547352912 +0200
***************
*** 1355,1361 ****
enddef
SetLocked()
END
! CheckScriptFailure(lines, 'E741: Value is locked: name')
lines =<< trim END
vim9script
--- 1355,1371 ----
enddef
SetLocked()
END
! CheckScriptFailure(lines, 'E741: Value is locked: name', 1)
!
! lines =<< trim END
! let s:legacy = 'one'
! lockvar s:legacy
! def SetLocked()
! s:legacy = 'two'
! enddef
! call SetLocked()
! END
! CheckScriptFailure(lines, 'E741: Value is locked: s:legacy', 1)
lines =<< trim END
vim9script
***************
*** 1365,1371 ****
SetGlobalConst()
g:globConst = 234
END
! CheckScriptFailure(lines, 'E741: Value is locked: globConst')
unlet g:globConst
lines =<< trim END
--- 1375,1381 ----
SetGlobalConst()
g:globConst = 234
END
! CheckScriptFailure(lines, 'E741: Value is locked: globConst', 1)
unlet g:globConst
lines =<< trim END
*** ../vim-8.2.2692/src/version.c 2021-04-02 14:35:11.572258008 +0200
--- src/version.c 2021-04-02 14:43:12.351264296 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2693,
/**/
--
The future isn't what it used to be.
/// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202104021244.132CiSSL2229448%40masaka.moolenaar.net.