Mercurial > vim
comparison src/evalvars.c @ 25348:75031a22be39 v8.2.3211
patch 8.2.3211: Vim9: argument types are not checked at compile time
Commit: https://github.com/vim/vim/commit/7973de35ba6840b7e106e2e8a8912522e9a2a960
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Jul 24 16:16:15 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Jul 2021 16:30:03 +0200 |
parents | 0aac8880d74d |
children | f03271631eb5 |
comparison
equal
deleted
inserted
replaced
25347:1052b30de969 | 25348:75031a22be39 |
---|---|
4110 buf_T *buf; | 4110 buf_T *buf; |
4111 char_u *varname; | 4111 char_u *varname; |
4112 dictitem_T *v; | 4112 dictitem_T *v; |
4113 int done = FALSE; | 4113 int done = FALSE; |
4114 | 4114 |
4115 if (in_vim9script() | |
4116 && (check_for_buffer_arg(argvars, 0) == FAIL | |
4117 || check_for_string_arg(argvars, 1) == FAIL)) | |
4118 return; | |
4119 | |
4115 varname = tv_get_string_chk(&argvars[1]); | 4120 varname = tv_get_string_chk(&argvars[1]); |
4116 buf = tv_get_buf_from_arg(&argvars[0]); | 4121 buf = tv_get_buf_from_arg(&argvars[0]); |
4117 | 4122 |
4118 rettv->v_type = VAR_STRING; | 4123 rettv->v_type = VAR_STRING; |
4119 rettv->vval.v_string = NULL; | 4124 rettv->vval.v_string = NULL; |
4249 char_u *varname, *bufvarname; | 4254 char_u *varname, *bufvarname; |
4250 typval_T *varp; | 4255 typval_T *varp; |
4251 | 4256 |
4252 if (check_secure()) | 4257 if (check_secure()) |
4253 return; | 4258 return; |
4259 | |
4260 if (in_vim9script() | |
4261 && (check_for_buffer_arg(argvars, 0) == FAIL | |
4262 || check_for_string_arg(argvars, 1) == FAIL)) | |
4263 return; | |
4264 | |
4254 varname = tv_get_string_chk(&argvars[1]); | 4265 varname = tv_get_string_chk(&argvars[1]); |
4255 buf = tv_get_buf_from_arg(&argvars[0]); | 4266 buf = tv_get_buf_from_arg(&argvars[0]); |
4256 varp = &argvars[2]; | 4267 varp = &argvars[2]; |
4257 | 4268 |
4258 if (buf != NULL && varname != NULL && varp != NULL) | 4269 if (buf != NULL && varname != NULL && varp != NULL) |