summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-29 20:45:16 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-29 20:45:16 +0100
commit4f1b083be43f351bc107541e7b0c9655a5d2c0bb (patch)
treedc39650176462f3bcd38f7d789d3f8c6b22c3dd0 /src/testdir
parent37fef16c225eabed28a3c7a0542d2eeef30d812b (diff)
patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is setv9.0.0322
Problem: Crash when no errors and 'quickfixtextfunc' is set. Solution: Do not handle errors if there aren't any.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_quickfix.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 31d36ef1d6..ee43cb685a 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -4107,6 +4107,22 @@ func Xgetlist_empty_tests(cchar)
endif
endfunc
+func Test_empty_list_quickfixtextfunc()
+ " This was crashing. Can only reproduce by running it in a separate Vim
+ " instance.
+ let lines =<< trim END
+ func s:Func(o)
+ cgetexpr '0'
+ endfunc
+ cope
+ let &quickfixtextfunc = 's:Func'
+ cgetfile [ex
+ END
+ call writefile(lines, 'Xquickfixtextfunc')
+ call RunVim([], [], '-e -s -S Xquickfixtextfunc -c qa')
+ call delete('Xquickfixtextfunc')
+endfunc
+
func Test_getqflist()
call Xgetlist_empty_tests('c')
call Xgetlist_empty_tests('l')