summaryrefslogtreecommitdiffstats
path: root/src/cmdhist.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-07-23 20:37:56 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-23 20:37:56 +0200
commit0ad871dc4dfe1026e14931a55c225616b63f4c5b (patch)
treea83e1cf4e231864e182c4b9ce70c37460d2200dd /src/cmdhist.c
parent1b862c466ba4242857eec581f67982d265005ef4 (diff)
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/cmdhist.c')
-rw-r--r--src/cmdhist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmdhist.c b/src/cmdhist.c
index dee95ba379..f3b8b007eb 100644
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -570,6 +570,11 @@ f_histdel(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
char_u buf[NUMBUFLEN];
char_u *str;
+ if (in_vim9script()
+ && (check_for_string_arg(argvars, 0) == FAIL
+ || check_for_opt_string_or_number_arg(argvars, 1) == FAIL))
+ return;
+
str = tv_get_string_chk(&argvars[0]); // NULL on type error
if (str == NULL)
n = 0;