0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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>
This commit is contained in:
Yegappan Lakshmanan
2023-12-16 14:46:40 +01:00
committed by Christian Brabandt
parent a185a31fc0
commit 062bb6b909
3 changed files with 114 additions and 0 deletions

View File

@@ -1088,6 +1088,8 @@ compile_for(char_u *arg_start, cctx_T *cctx)
}
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,