mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.3211: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks. Fix type check for matchaddpos(). (Yegappan Lakshmanan, closes #8619)
This commit is contained in:
committed by
Bram Moolenaar
parent
dd0b287c1e
commit
7973de35ba
@@ -4112,6 +4112,11 @@ f_getbufvar(typval_T *argvars, typval_T *rettv)
|
||||
dictitem_T *v;
|
||||
int done = FALSE;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_buffer_arg(argvars, 0) == FAIL
|
||||
|| check_for_string_arg(argvars, 1) == FAIL))
|
||||
return;
|
||||
|
||||
varname = tv_get_string_chk(&argvars[1]);
|
||||
buf = tv_get_buf_from_arg(&argvars[0]);
|
||||
|
||||
@@ -4251,6 +4256,12 @@ f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
|
||||
if (check_secure())
|
||||
return;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_buffer_arg(argvars, 0) == FAIL
|
||||
|| check_for_string_arg(argvars, 1) == FAIL))
|
||||
return;
|
||||
|
||||
varname = tv_get_string_chk(&argvars[1]);
|
||||
buf = tv_get_buf_from_arg(&argvars[0]);
|
||||
varp = &argvars[2];
|
||||
|
Reference in New Issue
Block a user