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

patch 8.2.2357: Vim9: crash when parsing function return type fails

Problem:    Vim9: crash when parsing function return type fails.
Solution:   Bail out and set return type to "unknown". (closes #7685)
This commit is contained in:
Bram Moolenaar
2021-01-15 19:04:32 +01:00
parent 883cf97f10
commit 648ea76e1d
3 changed files with 19 additions and 0 deletions

View File

@@ -3886,6 +3886,12 @@ define_function(exarg_T *eap, char_u *name_arg)
{
p = ret_type;
fp->uf_ret_type = parse_type(&p, &fp->uf_type_list, TRUE);
if (fp->uf_ret_type == NULL)
{
fp->uf_ret_type = &t_void;
SOURCING_LNUM = lnum_save;
goto erret;
}
}
SOURCING_LNUM = lnum_save;
}