summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-07-17 19:11:07 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-17 19:11:07 +0200
commita9a7c0c602b231dc37c4b0f62ade0421c84fca03 (patch)
treea7e6e2dcad98c9dd2244cf9c368360b71abf61a6 /src/job.c
parent20c370d9f2ee89cb854054edf71f5004f6efff77 (diff)
downloadvim-git-a9a7c0c602b231dc37c4b0f62ade0421c84fca03.tar.gz
patch 8.2.3173: Vim9: argument types are not checked at compile timev8.2.3173
Problem: Vim9: argument types are not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes #8581)
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/job.c b/src/job.c
index 189c06eb6..1271c779d 100644
--- a/src/job.c
+++ b/src/job.c
@@ -1725,6 +1725,13 @@ f_prompt_setprompt(typval_T *argvars, typval_T *rettv UNUSED)
buf_T *buf;
char_u *text;
+ if (in_vim9script()
+ && ((argvars[0].v_type != VAR_STRING
+ && argvars[0].v_type != VAR_NUMBER
+ && check_for_string_arg(argvars, 0) == FAIL)
+ || check_for_string_arg(argvars, 1) == FAIL))
+ return;
+
if (check_secure())
return;
buf = tv_get_buf(&argvars[0], FALSE);