1
0
forked from aniani/vim

patch 8.2.0449: Vim9: crash if return type is invalid

Problem:    Vim9: crash if return type is invalid. (Yegappan Lakshmanan)
Solution:   Always return some type, not NULL.
This commit is contained in:
Bram Moolenaar
2020-03-26 13:15:42 +01:00
parent 0e05de4622
commit cf3f8bf4dd
3 changed files with 8 additions and 3 deletions

View File

@@ -1375,19 +1375,19 @@ parse_type_member(char_u **arg, type_T *type, garray_T *type_list)
emsg(_("E1007: No white space allowed before <"));
else
emsg(_("E1008: Missing <type>"));
return NULL;
return type;
}
*arg = skipwhite(*arg + 1);
member_type = parse_type(arg, type_list);
if (member_type == NULL)
return NULL;
return type;
*arg = skipwhite(*arg);
if (**arg != '>')
{
emsg(_("E1009: Missing > after type"));
return NULL;
return type;
}
++*arg;