]> granicus.if.org Git - vim/commitdiff
patch 8.2.0721: Vim9: leaking memory when skipping v8.2.0721
authorBram Moolenaar <Bram@vim.org>
Sat, 9 May 2020 14:44:22 +0000 (16:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 May 2020 14:44:22 +0000 (16:44 +0200)
Problem:    Vim9: leaking memory when skipping.
Solution:   Disable skipping in generate_ppconst().

src/version.c
src/vim9compile.c

index 456516f97151a4587ad05390e10a46bd9f4ded4d..f51f51df918fa6107c961ad4d2275bbf0ee18186 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    721,
 /**/
     720,
 /**/
index 944efa197dd2424050aa640ba0a1f16e2f55b20b..a41972520bcbc8c9cb470fb55b41b0592cfa77e3 100644 (file)
@@ -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)