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.
diff --git a/src/userfunc.c b/src/userfunc.c
index a27c68d..c6a8a8c 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3716,7 +3716,7 @@
eap->nextcmd = NULL;
if ((*arg != NUL && *arg != '|' && *arg != '\n')
- && eval0(arg, &rettv, &eap->nextcmd, &evalarg) != FAIL)
+ && eval0(arg, &rettv, eap, &evalarg) != FAIL)
{
if (!eap->skip)
returning = do_return(eap, FALSE, TRUE, &rettv);
@@ -3773,7 +3773,7 @@
// instead to skip to any following command, e.g. for:
// :if 0 | call dict.foo().bar() | endif
++emsg_skip;
- if (eval0(eap->arg, &rettv, &eap->nextcmd, NULL) != FAIL)
+ if (eval0(eap->arg, &rettv, eap, NULL) != FAIL)
clear_tv(&rettv);
--emsg_skip;
return;