updated for version 7.3.715
Problem: Crash when calling setloclist() in BufUnload autocmd. (Marcin
Szamotulski)
Solution: Set w_llist to NULL when it was freed. Also add a test.
(Christian Brabandt)
diff --git a/src/testdir/test49.ok b/src/testdir/test49.ok
index 1842af2..0caef81 100644
--- a/src/testdir/test49.ok
+++ b/src/testdir/test49.ok
@@ -85,8 +85,10 @@
*** Test 83: OK (2835)
*** Test 84: OK (934782101)
*** Test 85: OK (198689)
---- Test 86: All tests were run with throwing exceptions on error.
+--- Test 86: No Crash for vimgrep on BufUnload
+*** Test 86: OK (0)
+--- Test 87: All tests were run with throwing exceptions on error.
The $VIMNOERRTHROW control is not configured.
---- Test 86: All tests were run with throwing exceptions on interrupt.
+--- Test 87: All tests were run with throwing exceptions on interrupt.
The $VIMNOINTTHROW control is not configured.
-*** Test 86: OK (50443995)
+*** Test 87: OK (50443995)
diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim
index 5e24e30..d17ea54 100644
--- a/src/testdir/test49.vim
+++ b/src/testdir/test49.vim
@@ -9603,9 +9603,28 @@
Xcheck 198689
+"-------------------------------------------------------------------------------
+" Test 86 setloclist crash {{{1
+"
+" Executing a setloclist() on BufUnload shouldn't crash Vim
+"-------------------------------------------------------------------------------
+
+func F
+ au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': 'tango down'}])
+
+ :lvimgrep /.*/ *
+endfunc
+
+XpathINIT
+
+ExecAsScript F
+
+delfunction F
+Xout "No Crash for vimgrep on BufUnload"
+Xcheck 0
"-------------------------------------------------------------------------------
-" Test 86: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1
+" Test 87: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1
"
" It is possible to configure Vim for throwing exceptions on error
" or interrupt, controlled by variables $VIMNOERRTHROW and