patch 8.2.0721: Vim9: leaking memory when skipping
Problem: Vim9: leaking memory when skipping.
Solution: Disable skipping in generate_ppconst().
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 944efa1..a419725 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2417,11 +2417,14 @@
{
int i;
int ret = OK;
+ int save_skip = cctx->ctx_skip;
+ cctx->ctx_skip = FALSE;
for (i = 0; i < ppconst->pp_used; ++i)
if (generate_tv_PUSH(cctx, &ppconst->pp_tv[i]) == FAIL)
ret = FAIL;
ppconst->pp_used = 0;
+ cctx->ctx_skip = save_skip;
return ret;
}
@@ -2754,6 +2757,7 @@
++ppconst->pp_used;
return OK;
}
+ clear_tv(&argvars[0]);
}
if (generate_ppconst(cctx, ppconst) == FAIL)