aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-24 06:50:48 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-06-24 07:26:06 +0800
commitaffeb5c6ddbda0c34a9513e393d2b05f622e1514 (patch)
tree7e6e6e9fb52b131b6fee5c412280353cbddae53e /src/nvim/testdir
parent589f418fceadfbbc10a6d1d37dd5d2ed026342b5 (diff)
downloadrneovim-affeb5c6ddbda0c34a9513e393d2b05f622e1514.tar.gz
rneovim-affeb5c6ddbda0c34a9513e393d2b05f622e1514.tar.bz2
rneovim-affeb5c6ddbda0c34a9513e393d2b05f622e1514.zip
vim-patch:8.2.5146: memory leak when substitute expression nests
Problem: Memory leak when substitute expression nests. Solution: Use an array of expression results. https://github.com/vim/vim/commit/44ddf19ec0ff59c969658ec7d9ed42070c59c51b Cherry-pick a comment change from patch 8.2.5057. N/A patches for version.c: vim-patch:8.2.5154: still mentioning version8, some cosmetic issues Problem: Still mentioning version8, some cosmetic issues. Solution: Prefer mentioning version9, cosmetic improvements. https://github.com/vim/vim/commit/abd56da30bae4a5c6c20b9363ccae12f7b126026
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_substitute.vim12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim
index 2c24ce436f..8483435062 100644
--- a/src/nvim/testdir/test_substitute.vim
+++ b/src/nvim/testdir/test_substitute.vim
@@ -831,7 +831,7 @@ func Test_using_old_sub()
~
s/
endfunc
- silent! s/\%')/\=Repl()
+ silent! s/\%')/\=Repl()
delfunc Repl
bwipe!
@@ -1134,4 +1134,14 @@ func Test_substitute_short_cmd()
bw!
endfunc
+" This should be done last to reveal a memory leak when vim_regsub_both() is
+" called to evaluate an expression but it is not used in a second call.
+func Test_z_substitute_expr_leak()
+ func SubExpr()
+ ~n
+ endfunc
+ silent! s/\%')/\=SubExpr()
+ delfunc SubExpr
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab