diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-07-23 20:37:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-23 20:37:56 +0200 |
commit | 0ad871dc4dfe1026e14931a55c225616b63f4c5b (patch) | |
tree | a83e1cf4e231864e182c4b9ce70c37460d2200dd /src/popupwin.c | |
parent | 1b862c466ba4242857eec581f67982d265005ef4 (diff) | |
download | vim-git-0ad871dc4dfe1026e14931a55c225616b63f4c5b.tar.gz |
patch 8.2.3206: Vim9: argument types are not checked at compile timev8.2.3206
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks. (Yegappan Lakshmanan, closes #8611)
Diffstat (limited to 'src/popupwin.c')
-rw-r--r-- | src/popupwin.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index 747852735..f433b875a 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2597,9 +2597,16 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED) void f_popup_settext(typval_T *argvars, typval_T *rettv UNUSED) { - int id = (int)tv_get_number(&argvars[0]); - win_T *wp = find_popup_win(id); + int id; + win_T *wp; + + if (in_vim9script() + && (check_for_number_arg(argvars, 0) == FAIL + || check_for_string_or_list_arg(argvars, 1) == FAIL)) + return; + id = (int)tv_get_number(&argvars[0]); + wp = find_popup_win(id); if (wp != NULL) { if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_LIST) |