To: vim_dev@googlegroups.com Subject: Patch 8.2.2465 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2465 Problem: Using freed memory in :psearch. (houyunsong) Solution: Check the current window is still valid. Fix flaky test. Files: src/search.c, src/testdir/test_autocmd.vim *** ../vim-8.2.2464/src/search.c 2021-01-04 12:41:49.507891351 +0100 --- src/search.c 2021-02-03 22:59:42.487477408 +0100 *************** *** 3864,3869 **** --- 3864,3871 ---- #if defined(FEAT_QUICKFIX) if (g_do_tagpreview != 0) { + if (!win_valid(curwin_save)) + break; if (!GETFILE_SUCCESS(getfile( curwin_save->w_buffer->b_fnum, NULL, NULL, TRUE, lnum, FALSE))) *** ../vim-8.2.2464/src/testdir/test_autocmd.vim 2021-02-03 21:56:53.499701546 +0100 --- src/testdir/test_autocmd.vim 2021-02-03 23:02:48.310847964 +0100 *************** *** 60,66 **** let g:triggered = 0 au CursorHoldI * let g:triggered += 1 set updatetime=20 ! call timer_start(100, 'ExitInsertMode') call feedkeys('a', 'x!') call assert_equal(1, g:triggered) unlet g:triggered --- 60,66 ---- let g:triggered = 0 au CursorHoldI * let g:triggered += 1 set updatetime=20 ! call timer_start(200, 'ExitInsertMode') call feedkeys('a', 'x!') call assert_equal(1, g:triggered) unlet g:triggered *************** *** 2413,2421 **** pedit xx n x ! au WinEnter * quit split ! au! WinEnter endfunc func Test_BufWrite_lockmarks() --- 2413,2430 ---- pedit xx n x ! augroup winenter ! au WinEnter * if winnr('$') > 2 | quit | endif ! augroup END split ! ! augroup winenter ! au! WinEnter ! augroup END ! ! bwipe xx ! bwipe x ! pclose endfunc func Test_BufWrite_lockmarks() *************** *** 2737,2740 **** --- 2746,2762 ---- au! BufWinLeave endfunc + func Test_autocmd_quit_psearch() + sn aa bb + augroup aucmd_win_test + au! + au BufEnter,BufLeave,BufNew,WinEnter,WinLeave,WinNew * if winnr('$') > 1 | q | endif + augroup END + ps / + + augroup aucmd_win_test + au! + augroup END + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2464/src/version.c 2021-02-03 21:56:53.503701528 +0100 --- src/version.c 2021-02-03 22:25:10.025984263 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2465, /**/ -- CONCORDE: Message for you, sir. He falls forward revealing the arrow with the note. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///