changeset 20332:a407e243c55c v8.2.0721

patch 8.2.0721: Vim9: leaking memory when skipping Commit: https://github.com/vim/vim/commit/497f76bfbf9d5fe951221573d23696bb9e512c0b Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 9 16:44:22 2020 +0200 patch 8.2.0721: Vim9: leaking memory when skipping Problem: Vim9: leaking memory when skipping. Solution: Disable skipping in generate_ppconst().
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 May 2020 16:45:03 +0200
parents 85b7b3c3e19a
children f4c695970c1f
files src/version.c src/vim9compile.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2417,11 +2417,14 @@ generate_ppconst(cctx_T *cctx, ppconst_T
 {
     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)