From f6caa35e6576dc97a70a31e1919a320d67f169ca Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 3 Dec 2022 20:15:52 +0800 Subject: vim-patch:8.2.4261: accessing invalid memory in a regular expression Problem: Accessing invalid memory when a regular expression checks the Visual area while matching in a string. Solution: Do not try matching the Visual area in a string. https://github.com/vim/vim/commit/679d66c2d21dfe03d0f89b9a818b0aaebb4c3b87 Use CheckScriptFailure() instead of v9.CheckScriptFailure(). Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_help.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/testdir/test_help.vim') diff --git a/src/nvim/testdir/test_help.vim b/src/nvim/testdir/test_help.vim index b370a1e13e..6cebc49b61 100644 --- a/src/nvim/testdir/test_help.vim +++ b/src/nvim/testdir/test_help.vim @@ -1,6 +1,7 @@ " Tests for :help source check.vim +source vim9.vim func SetUp() let s:vimruntime = $VIMRUNTIME @@ -207,5 +208,15 @@ func Test_help_long_argument() endtry endfunc +func Test_help_using_visual_match() + let lines =<< trim END + call setline(1, ' ') + /^ + exe "normal \\" + h5\%V€] + END + call CheckScriptFailure(lines, 'E149:') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit