0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.1049: Vim9: leaking memory when using continuation line

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.
This commit is contained in:
Bram Moolenaar
2020-06-24 20:34:03 +02:00
parent 9d40c63c7d
commit b171fb1790
23 changed files with 90 additions and 55 deletions

View File

@@ -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));