Mercurial > vim
diff src/testdir/test_autocmd.vim @ 29117:c7a8d4bf4d04 v8.2.5079
patch 8.2.5079: DirChanged autocommand may use freed memory
Commit: https://github.com/vim/vim/commit/d8c9d32c8932e93008bfd4e8828ed42f4e9f8315
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 12 11:49:16 2022 +0100
patch 8.2.5079: DirChanged autocommand may use freed memory
Problem: DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution: Free the memory later. (closes https://github.com/vim/vim/issues/10555)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Jun 2022 13:00:03 +0200 |
parents | 036b4d49c4a0 |
children | bed794d67f72 |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2107,6 +2107,13 @@ function Test_dirchanged_global() call assert_equal(expected, s:li) exe 'lcd ' .. fnameescape(s:dir_bar) call assert_equal(expected, s:li) + + exe 'cd ' .. s:dir_foo + exe 'cd ' .. s:dir_bar + autocmd! test_dirchanged DirChanged global let g:result = expand("<afile>") + cd - + call assert_equal(s:dir_foo, g:result) + call s:After_test_dirchanged() endfunc