patch 8.2.5169: nested :source may use NULL pointer
Problem: Nested :source may use NULL pointer.
Solution: Do not use the NULL pointer.
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim
index c9f58c2..07dc59d 100644
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -7528,6 +7528,25 @@
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