comparison src/vim9compile.c @ 23418:681f042ae5ac v8.2.2252

patch 8.2.2252: Vim9: crash when using lambda without return type in dict Commit: https://github.com/vim/vim/commit/6b55377303968e1624339cd95053201d5acdcaa2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 31 13:31:23 2020 +0100 patch 8.2.2252: Vim9: crash when using lambda without return type in dict Problem: Vim9: crash when using lambda without return type in dict. Solution: Without a return type use t_unknown. (closes https://github.com/vim/vim/issues/7587)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Dec 2020 13:45:04 +0100
parents 9bd3873b13e2
children bb0c53f4ef8b
comparison
equal deleted inserted replaced
23417:4dfa0cd43a51 23418:681f042ae5ac
4835 return NULL; 4835 return NULL;
4836 4836
4837 if (cctx->ctx_skip != SKIP_YES) 4837 if (cctx->ctx_skip != SKIP_YES)
4838 { 4838 {
4839 stack_type = ((type_T **)stack->ga_data)[stack->ga_len - 1]; 4839 stack_type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
4840 if (check_return_type && cctx->ctx_ufunc->uf_ret_type == NULL) 4840 if (check_return_type && (cctx->ctx_ufunc->uf_ret_type == NULL
4841 || cctx->ctx_ufunc->uf_ret_type == &t_unknown))
4841 { 4842 {
4842 cctx->ctx_ufunc->uf_ret_type = stack_type; 4843 cctx->ctx_ufunc->uf_ret_type = stack_type;
4843 } 4844 }
4844 else 4845 else
4845 { 4846 {