summaryrefslogtreecommitdiff
path: root/src/testing.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-07-10 13:15:41 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-10 13:15:41 +0200
commit5b73992d8f82be7ac4b6f46c17f53ffb9640e5fa (patch)
treeff59a04ff0b60de8b527e5fe9d5e7df9bf50f5ce /src/testing.c
parent9da32e4d578f4e93ef5397f9dd13e2c28b2a2595 (diff)
downloadvim-git-5b73992d8f82be7ac4b6f46c17f53ffb9640e5fa.tar.gz
patch 8.2.3135: Vim9: builtin function arguments not checked at compile timev8.2.3135
Problem: Vim9: builtin function arguments not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes #8539)
Diffstat (limited to 'src/testing.c')
-rw-r--r--src/testing.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testing.c b/src/testing.c
index f01f73a42..c2389bdee 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -1096,7 +1096,10 @@ f_test_garbagecollect_soon(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
void
f_test_ignore_error(typval_T *argvars, typval_T *rettv UNUSED)
{
- ignore_error_for_testing(tv_get_string(&argvars[0]));
+ if (argvars[0].v_type != VAR_STRING)
+ emsg(_(e_invarg));
+ else
+ ignore_error_for_testing(tv_get_string(&argvars[0]));
}
void