diff src/testdir/test_autocmd.vim @ 12630:560adb3eed8b v8.0.1193

patch 8.0.1193: crash when wiping out a buffer after using getbufinfo() commit https://github.com/vim/vim/commit/b2c8750c4e95f64a8dff912af81e13318b3f6ed6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 14 21:15:58 2017 +0200 patch 8.0.1193: crash when wiping out a buffer after using getbufinfo() Problem: Crash when wiping out a buffer after using getbufinfo(). (Yegappan Lakshmanan) Solution: Remove b:changedtick from the buffer variables.
author Christian Brabandt <cb@256bit.org>
date Sat, 14 Oct 2017 21:30:05 +0200
parents 27a2fc398671
children 1fad9675d8fd
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -769,10 +769,14 @@ func Test_BufLeave_Wipe()
   bwipe!
   call assert_equal(1, line('$'))
   call assert_equal('', bufname('%'))
-  call assert_equal(1, len(getbufinfo()))
+  let g:bufinfo = getbufinfo()
+  call assert_equal(1, len(g:bufinfo))
 
   call delete('Xxx1')
   call delete('Xxx2')
   %bwipe
   au! BufLeave
+
+  " check that bufinfo doesn't contain a pointer to freed memory
+  call test_garbagecollect_now()
 endfunc