comparison src/vim9compile.c @ 22504:47e15b82dba1 v8.2.1800

patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Commit: https://github.com/vim/vim/commit/dda749ce85cc07000faa86bfd2ceaecd8e4805fc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 4 17:24:29 2020 +0200 patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Problem: Vim9: memory leak if "if" condition is invalid. Solution: Free ppconst earlier.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Oct 2020 17:30:03 +0200
parents ef8a3177edc1
children ac8c4a8b8cba
comparison
equal deleted inserted replaced
22503:7717027d6bf6 22504:47e15b82dba1
5719 int error = FALSE; 5719 int error = FALSE;
5720 int v; 5720 int v;
5721 5721
5722 // The expression results in a constant. 5722 // The expression results in a constant.
5723 v = tv_get_bool_chk(&ppconst.pp_tv[0], &error); 5723 v = tv_get_bool_chk(&ppconst.pp_tv[0], &error);
5724 clear_ppconst(&ppconst);
5724 if (error) 5725 if (error)
5725 return NULL; 5726 return NULL;
5726 cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES; 5727 cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES;
5727 clear_ppconst(&ppconst);
5728 } 5728 }
5729 else 5729 else
5730 { 5730 {
5731 // Not a constant, generate instructions for the expression. 5731 // Not a constant, generate instructions for the expression.
5732 cctx->ctx_skip = SKIP_UNKNOWN; 5732 cctx->ctx_skip = SKIP_UNKNOWN;