1
0
forked from aniani/vim

patch 8.2.5169: nested :source may use NULL pointer

Problem:    Nested :source may use NULL pointer.
Solution:   Do not use the NULL pointer.
This commit is contained in:
Bram Moolenaar
2022-06-27 20:15:10 +01:00
parent fee511c1d3
commit 79481367a4
3 changed files with 46 additions and 19 deletions

View File

@@ -7528,6 +7528,25 @@ func Test_for_over_string()
call assert_equal('', res)
endfunc
" Test for deeply nested :source command {{{1
func Test_deeply_nested_source()
let lines =<< trim END
so
sil 0scr
delete
so
0
END
call writefile(["vim9 silent! @0 \n/"] + lines, 'Xnested.vim')
" this must not crash
let cmd = GetVimCommand() .. " -e -s -S Xnested.vim -c qa!"
call system(cmd)
call delete('Xnested.vim')
endfunc
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker