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)
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 0e44b76..8be8f6b 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -522,10 +522,12 @@
{
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 @@
*arg = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum]
+ off;
+ evalarg.eval_using_cmdline = FALSE;
}
clear_evalarg(&evalarg, NULL);