0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.0554: using freed memory when command follows lambda

Problem:    Using freed memory when command follows lambda.
Solution:   Don't free what is still in use. (closes #11201)
This commit is contained in:
Bram Moolenaar
2022-09-23 12:44:25 +01:00
parent f5f4e85f01
commit f8addf1ca1
4 changed files with 37 additions and 7 deletions

View File

@@ -522,10 +522,12 @@ compile_load(
{
type = lvar.lv_type;
idx = lvar.lv_idx;
outer_loop_depth = lvar.lv_loop_depth;
outer_loop_idx = lvar.lv_loop_idx;
if (lvar.lv_from_outer != 0)
{
gen_load_outer = lvar.lv_from_outer;
outer_loop_depth = lvar.lv_loop_depth;
outer_loop_idx = lvar.lv_loop_idx;
}
else
gen_load = TRUE;
}
@@ -1096,6 +1098,7 @@ compile_lambda(char_u **arg, cctx_T *cctx)
*arg = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum]
+ off;
evalarg.eval_using_cmdline = FALSE;
}
clear_evalarg(&evalarg, NULL);