comparison src/testdir/test_substitute.vim @ 28909:1890fa76a634 v8.2.4977

patch 8.2.4977: memory access error when substitute expression changes window Commit: https://github.com/vim/vim/commit/e2bd8600b873d2cd1f9d667c28cba8b1dba18839 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 18 13:11:57 2022 +0100 patch 8.2.4977: memory access error when substitute expression changes window Problem: Memory access error when substitute expression changes window. Solution: Disallow changing window in substitute expression.
author Bram Moolenaar <Bram@vim.org>
date Wed, 18 May 2022 14:15:02 +0200
parents 553ff405b719
children 48d74a5822eb
comparison
equal deleted inserted replaced
28908:89001c986b21 28909:1890fa76a634
998 delfunc Repl 998 delfunc Repl
999 bwipe! 999 bwipe!
1000 set nocompatible 1000 set nocompatible
1001 endfunc 1001 endfunc
1002 1002
1003 " This was switching windows in between computing the length and using it.
1004 func Test_sub_change_window()
1005 silent! lfile
1006 sil! norm o0000000000000000000000000000000000000000000000000000
1007 func Repl()
1008 lopen
1009 endfunc
1010 silent! s/\%')/\=Repl()
1011 bwipe!
1012 bwipe!
1013 delfunc Repl
1014 endfunc
1015
1003 " Test for the 2-letter and 3-letter :substitute commands 1016 " Test for the 2-letter and 3-letter :substitute commands
1004 func Test_substitute_short_cmd() 1017 func Test_substitute_short_cmd()
1005 new 1018 new
1006 call setline(1, ['one', 'one one one']) 1019 call setline(1, ['one', 'one one one'])
1007 s/one/two 1020 s/one/two