diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-07-20 17:51:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-20 17:51:51 +0200 |
commit | 83494b4ac61898f687d6ef9dce4bad5802fb8e51 (patch) | |
tree | 36f06f4a70bd9a515527064cd8985029ab27c6a6 /src/cmdexpand.c | |
parent | 9bb0dad0d8283c86fddf5b950f4fbb6fb8f12741 (diff) |
patch 8.2.3188: Vim9: argument types are not checked at compile timev8.2.3188
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks, also at runtime. (Yegappan
Lakshmanan, closes #8587)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r-- | src/cmdexpand.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 9b6d9aa81d..362ed77e24 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2891,6 +2891,12 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH | WILD_NO_BEEP; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL + || check_for_opt_bool_arg(argvars, 2) == FAIL)) + return; + if (argvars[1].v_type != VAR_STRING) { semsg(_(e_invarg2), "type must be a string"); |