aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-21 16:00:45 +0800
committerGitHub <noreply@github.com>2022-07-21 16:00:45 +0800
commit6a7d00469bd64e8fe63468b5c1643087432709e9 (patch)
treec24e6965b63350916f74e2e18982bbad66e2306d /src/nvim/testdir
parent1f1863ed54355c314a5016560809e65c3fb0cb79 (diff)
downloadrneovim-6a7d00469bd64e8fe63468b5c1643087432709e9.tar.gz
rneovim-6a7d00469bd64e8fe63468b5c1643087432709e9.tar.bz2
rneovim-6a7d00469bd64e8fe63468b5c1643087432709e9.zip
vim-patch:9.0.0047: using freed memory with recursive substitute (#19457)
Problem: Using freed memory with recursive substitute. Solution: Always make a copy for reg_prev_sub. https://github.com/vim/vim/commit/32acf1f1a72ebb9d8942b9c9d80023bf1bb668ea
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_regexp_latin.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim
index 82d250e8b3..d08a980787 100644
--- a/src/nvim/testdir/test_regexp_latin.vim
+++ b/src/nvim/testdir/test_regexp_latin.vim
@@ -1027,4 +1027,15 @@ func Test_using_invalid_visual_position()
bwipe!
endfunc
+func Test_recursive_substitute_expr()
+ new
+ func Repl()
+ s
+ endfunc
+ silent! s/\%')/~\=Repl()
+
+ bwipe!
+ delfunc Repl
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab