patch 8.2.1434: Vim9: crash when lambda uses outer function argument
Problem: Vim9: crash when lambda uses outer function argument.
Solution: Set the flag that the outer context is used.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 87bb0e2..889a5d5 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2135,7 +2135,10 @@
if (gen_load)
res = generate_LOAD(cctx, ISN_LOAD, idx, NULL, type);
if (gen_load_outer)
+ {
res = generate_LOAD(cctx, ISN_LOADOUTER, idx, NULL, type);
+ cctx->ctx_outer_used = TRUE;
+ }
}
*arg = end;