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)
diff --git a/src/userfunc.c b/src/userfunc.c
index ded9ef7..7ca8186 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3886,6 +3886,12 @@
{
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;
}