Patch 8.2.0537
Problem: Vim9: no check for sandbox when setting v:var.
Solution: Check for sandbox.
Files: src/evalvars.c, src/testdir/test_vim9_script.vim
*** ../vim-8.2.0536/src/evalvars.c 2020-04-09 19:34:40.051480485 +0200
--- src/evalvars.c 2020-04-09 20:10:30.357951082 +0200
***************
*** 1978,1983 ****
--- 1978,1994 ----
clear_tv(tv);
return FAIL;
}
+ // VV_RO is also checked when compiling, but let's check here as well.
+ if (vimvars[idx].vv_flags & VV_RO)
+ {
+ semsg(_(e_readonlyvar), vimvars[idx].vv_name);
+ return FAIL;
+ }
+ if (sandbox && (vimvars[idx].vv_flags & VV_RO_SBX))
+ {
+ semsg(_(e_readonlysbx), vimvars[idx].vv_name);
+ return FAIL;
+ }
clear_tv(&vimvars[idx].vv_di.di_tv);
vimvars[idx].vv_di.di_tv = *tv;
return OK;
*** ../vim-8.2.0536/src/testdir/test_vim9_script.vim 2020-04-06
21:35:02.464237765 +0200
--- src/testdir/test_vim9_script.vim 2020-04-09 20:08:42.110370432 +0200
***************
*** 170,175 ****
--- 170,180 ----
assert_equal(5678, nr)
enddef
+ def Mess(): string
+ v:foldstart = 123
+ return 'xxx'
+ enddef
+
func Test_assignment_failure()
call CheckDefFailure(['let var=234'], 'E1004:')
call CheckDefFailure(['let var =234'], 'E1004:')
***************
*** 207,212 ****
--- 212,220 ----
call CheckDefFailure(['let var: dict <number>'], 'E1068:')
call CheckDefFailure(['let var: dict<number'], 'E1009:')
+
+ call assert_fails('s/^/\=Mess()/n', 'E794:')
+ call CheckDefFailure(['let var: dict<number'], 'E1009:')
endfunc
func Test_wrong_type()
*** ../vim-8.2.0536/src/version.c 2020-04-09 19:34:40.051480485 +0200
--- src/version.c 2020-04-09 19:55:55.301425682 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 537,
/**/
--
FROG: How you English say: I one more time, mac, I unclog my nose towards
you, sons of a window-dresser, so, you think you could out-clever us
French fellows with your silly knees-bent creeping about advancing
behaviour. (blows a raspberry) I wave my private parts at your aunties,
you brightly-coloured, mealy-templed, cranberry-smelling, electric
donkey-bottom biters.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ 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/202004091811.039IBPW8006193%40masaka.moolenaar.net.