comparison src/testdir/test_quickfix.vim @ 29968:b01273bbc75e v9.0.0322

patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set Commit: https://github.com/vim/vim/commit/4f1b083be43f351bc107541e7b0c9655a5d2c0bb Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 29 20:45:16 2022 +0100 patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set Problem: Crash when no errors and 'quickfixtextfunc' is set. Solution: Do not handle errors if there aren't any.
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Aug 2022 22:00:05 +0200
parents c554ac4c17c3
children d891115c0aea
comparison
equal deleted inserted replaced
29967:726b889782e2 29968:b01273bbc75e
4105 \ 'changedtick' : 0, 'filewinid' : 0, 'qfbufnr' : 0, 4105 \ 'changedtick' : 0, 'filewinid' : 0, 'qfbufnr' : 0,
4106 \ 'quickfixtextfunc' : ''}, g:Xgetlist({'nr' : 5, 'all' : 0})) 4106 \ 'quickfixtextfunc' : ''}, g:Xgetlist({'nr' : 5, 'all' : 0}))
4107 endif 4107 endif
4108 endfunc 4108 endfunc
4109 4109
4110 func Test_empty_list_quickfixtextfunc()
4111 " This was crashing. Can only reproduce by running it in a separate Vim
4112 " instance.
4113 let lines =<< trim END
4114 func s:Func(o)
4115 cgetexpr '0'
4116 endfunc
4117 cope
4118 let &quickfixtextfunc = 's:Func'
4119 cgetfile [ex
4120 END
4121 call writefile(lines, 'Xquickfixtextfunc')
4122 call RunVim([], [], '-e -s -S Xquickfixtextfunc -c qa')
4123 call delete('Xquickfixtextfunc')
4124 endfunc
4125
4110 func Test_getqflist() 4126 func Test_getqflist()
4111 call Xgetlist_empty_tests('c') 4127 call Xgetlist_empty_tests('c')
4112 call Xgetlist_empty_tests('l') 4128 call Xgetlist_empty_tests('l')
4113 endfunc 4129 endfunc
4114 4130