patch 9.0.2173: Vim9: crash when compiling for statement and non-existing type
Problem: Vim9: Vim crashes when compiling a for statement with a
non-existing type
Solution: Error out when lhs_type is not null
closes: #13703
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9cmds.c b/src/vim9cmds.c
index 07e6501..a276d53 100644
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -1088,6 +1088,8 @@
}
p = skipwhite(p + 1);
lhs_type = parse_type(&p, cctx->ctx_type_list, TRUE);
+ if (lhs_type == NULL)
+ goto failed;
}
if (get_var_dest(name, &dest, CMD_for, &opt_flags,