0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.3237: when a builtin function gives an error processing continues

Problem:    When a builtin function gives an error processing continues.
Solution:   In Vim9 script return FAIL in get_func_tv().
This commit is contained in:
Bram Moolenaar
2021-07-28 19:34:14 +02:00
parent eaf3f36168
commit 327d3ee455
3 changed files with 23 additions and 1 deletions

View File

@@ -1674,7 +1674,8 @@ get_func_tv(
if (ret == OK)
{
int i = 0;
int i = 0;
int did_emsg_before = did_emsg;
if (get_vim_var_nr(VV_TESTING))
{
@@ -1689,6 +1690,10 @@ get_func_tv(
}
ret = call_func(name, len, rettv, argcount, argvars, funcexe);
if (in_vim9script() && did_emsg > did_emsg_before)
// An error in a builtin function does not return FAIL, but we do
// want to abort further processing if an error was given.
ret = FAIL;
funcargs.ga_len -= i;
}