Mercurial > vim
diff src/structs.h @ 26053:e861c5aaedd8 v8.2.3560
patch 8.2.3560: using freed memory with lambda
Commit: https://github.com/vim/vim/commit/844fb64a605d60131827503a001b2d1aa232b078
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 23 13:32:30 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 23 Oct 2021 14:45:04 +0200 |
parents | ac330e2fecc4 |
children | f2392648af3e |
line wrap: on
line diff
--- a/src/structs.h +++ b/src/structs.h @@ -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;