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

patch 8.2.3560: using freed memory with lambda

Problem:    Using freed memory with lambda.
Solution:   Do not free lines early, keep them until the expression is
            finished.
This commit is contained in:
Bram Moolenaar
2021-10-23 13:32:30 +01:00
parent ee56f3f119
commit 844fb64a60
8 changed files with 63 additions and 20 deletions

View File

@@ -1906,8 +1906,11 @@ typedef struct {
// pointer to the last line obtained with getsourceline()
char_u *eval_tofree;
// pointer to the last line of an inline function
char_u *eval_tofree_cmdline;
// array with lines of an inline function
garray_T eval_tofree_ga;
// set when "arg" points into the last entry of "eval_tofree_ga"
int eval_using_cmdline;
// pointer to the lines concatenated for a lambda.
char_u *eval_tofree_lambda;