summaryrefslogtreecommitdiffstats
path: root/src/ex_eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-24 20:34:03 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-24 20:34:03 +0200
commitb171fb179053fa631fec74911b5fb9374cb6a8a1 (patch)
treec45ae9287bf07033cc4f3bf43529b7548ba432c9 /src/ex_eval.c
parent9d40c63c7dc8c3eb3886c58dcd334bc7f37eceba (diff)
patch 8.2.1049: Vim9: leaking memory when using continuation linev8.2.1049
Problem: Vim9: leaking memory when using continuation line. Solution: Keep a pointer to the continuation line in evalarg_T. Centralize checking for a next command.
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r--src/ex_eval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c
index cb32bd0791..8b8a256957 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -900,7 +900,7 @@ ex_eval(exarg_T *eap)
evalarg.eval_flags = eap->skip ? 0 : EVAL_EVALUATE;
evalarg.eval_cookie = eap->getline == getsourceline ? eap->cookie : NULL;
- if (eval0(eap->arg, &tv, &eap->nextcmd, &evalarg) == OK)
+ if (eval0(eap->arg, &tv, eap, &evalarg) == OK)
clear_tv(&tv);
}
@@ -929,7 +929,7 @@ ex_if(exarg_T *eap)
skip = did_emsg || got_int || did_throw || (cstack->cs_idx > 0
&& !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE));
- result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+ result = eval_to_bool(eap->arg, &error, eap, skip);
if (!skip && !error)
{
@@ -1041,7 +1041,7 @@ ex_else(exarg_T *eap)
if (eap->cmdidx == CMD_elseif)
{
- result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+ result = eval_to_bool(eap->arg, &error, eap, skip);
// When throwing error exceptions, we want to throw always the first
// of several errors in a row. This is what actually happens when
@@ -1103,7 +1103,7 @@ ex_while(exarg_T *eap)
/*
* ":while bool-expr"
*/
- result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+ result = eval_to_bool(eap->arg, &error, eap, skip);
}
else
{
@@ -1122,7 +1122,7 @@ ex_while(exarg_T *eap)
else
{
// Evaluate the argument and get the info in a structure.
- fi = eval_for_line(eap->arg, &error, &eap->nextcmd, skip);
+ fi = eval_for_line(eap->arg, &error, eap, skip);
cstack->cs_forinfo[cstack->cs_idx] = fi;
}
@@ -1322,7 +1322,7 @@ ex_throw(exarg_T *eap)
char_u *value;
if (*arg != NUL && *arg != '|' && *arg != '\n')
- value = eval_to_string_skip(arg, &eap->nextcmd, eap->skip);
+ value = eval_to_string_skip(arg, eap, eap->skip);
else
{
emsg(_(e_argreq));