]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1864: still crash with bt_quickfix1_poc v9.0.1864
authorChristian Brabandt <cb@256bit.org>
Mon, 4 Sep 2023 20:09:12 +0000 (22:09 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 4 Sep 2023 20:09:12 +0000 (22:09 +0200)
Problem:  crash with bt_quickfix1_poc when cleaning up
          and EXITFREE is defined
Solution: Test if buffer is valid in a window, else close
          window directly, don't try to access buffer properties

While at it, increase the crash timeout slightly, so that CI has a
chance to finish processing the test_crash() test.

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_crash.vim
src/version.c
src/window.c

index b997cc1d29f29115df8fb2ae5666419a286062a3..8c79d3abd6a1721ce439e801889bd304a64baca7 100644 (file)
@@ -40,7 +40,7 @@ func Test_crash1()
   " clean up
   call delete('Xerr')
   " This test takes a bit longer
-  call TermWait(buf, 500)
+  call TermWait(buf, 1000)
 
   let file = 'crash/poc_tagfunc.vim'
   let args = printf(cmn_args, vim, file)
@@ -55,7 +55,7 @@ func Test_crash1()
     \ '  && echo "crash 6: [OK]" >> X_crash1_result.txt' .. "\<cr>")
   " clean up
   call delete('X')
-  call TermWait(buf, 200)
+  call TermWait(buf, 1000)
 
   " clean up
   exe buf .. "bw!"
index a19b81eb632f239442d9fe02f167c125dbbbb0e3..c2faee46cc57cc6e34fe677d8168f8d708b4c528 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1864,
 /**/
     1863,
 /**/
index 152365e7d93e2a1eb2b87d247f292e4e138c4e38..1af2395df8b91c2ab0113479ea6c03396226591d 100644 (file)
@@ -4158,6 +4158,13 @@ close_others(
        if (wp == curwin)               // don't close current window
            continue;
 
+       // autoccommands messed this one up
+       if (!buf_valid(wp->w_buffer) && win_valid(wp))
+       {
+           wp->w_buffer = NULL;
+           win_close(wp, 0);
+           continue;
+       }
        // Check if it's allowed to abandon this window
        r = can_abandon(wp->w_buffer, forceit);
        if (!win_valid(wp))             // autocommands messed wp up