summaryrefslogtreecommitdiff
path: root/src/filepath.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/filepath.c
parent1b862c466ba4242857eec581f67982d265005ef4 (diff)
downloadvim-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/filepath.c')
-rw-r--r--src/filepath.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 0d59a6b4f..900c5bd69 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -2180,6 +2180,12 @@ f_writefile(typval_T *argvars, typval_T *rettv)
if (check_secure())
return;
+ if (in_vim9script()
+ && (check_for_list_or_blob_arg(argvars, 0) == FAIL
+ || check_for_string_arg(argvars, 1) == FAIL
+ || check_for_opt_string_arg(argvars, 2) == FAIL))
+ return;
+
if (argvars[0].v_type == VAR_LIST)
{
list = argvars[0].vval.v_list;