diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-05-09 16:44:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-05-09 16:44:22 +0200 |
commit | 497f76bfbf9d5fe951221573d23696bb9e512c0b (patch) | |
tree | 5e181f427107df0f001635125fda7189e659d9f4 | |
parent | b1062eb23e7a7a8b44f3416e79c3b28aa6c6c229 (diff) | |
download | vim-git-497f76bfbf9d5fe951221573d23696bb9e512c0b.tar.gz |
patch 8.2.0721: Vim9: leaking memory when skippingv8.2.0721
Problem: Vim9: leaking memory when skipping.
Solution: Disable skipping in generate_ppconst().
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/version.c b/src/version.c index 456516f97..f51f51df9 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 721, +/**/ 720, /**/ 719, diff --git a/src/vim9compile.c b/src/vim9compile.c index 944efa197..a41972520 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -2417,11 +2417,14 @@ generate_ppconst(cctx_T *cctx, ppconst_T *ppconst) { 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 @@ compile_call( ++ppconst->pp_used; return OK; } + clear_tv(&argvars[0]); } if (generate_ppconst(cctx, ppconst) == FAIL) |