Mercurial > vim
diff src/vim9compile.c @ 19785:99248f0ff29d v8.2.0449
patch 8.2.0449: Vim9: crash if return type is invalid
Commit: https://github.com/vim/vim/commit/cf3f8bf4ddfbc0f5ce53f0c9270dc15567f4feea
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 26 13:15:42 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 26 Mar 2020 13:30:04 +0100 |
parents | 9daed26b788b |
children | c1c88b333481 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1375,19 +1375,19 @@ parse_type_member(char_u **arg, type_T * 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;