From 7cb38d5ac41efc1dce80a2e40c9c55f8a3802d61 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 8 Sep 2019 11:04:37 +0900 Subject: vim-patch:8.1.1563: crash when using closures Problem: Crash when using closures. Solution: Set reference in varlist of funccal when running the garbage collector. (Ozaki Kiichi, closes vim/vim#4554, closes vim/vim#4547) https://github.com/vim/vim/commit/6e5000d493b4f385f901eb97f3ce0c8088373403 --- src/nvim/testdir/test_vimscript.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index d2f13ff072..3e2e1795dc 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1409,6 +1409,17 @@ func Test_compound_assignment_operators() let @/ = '' endfunc +func! Test_funccall_garbage_collect() + func Func(x, ...) + call add(a:x, a:000) + endfunc + call Func([], []) + " Must not crash cause by invalid freeing + call test_garbagecollect_now() + call assert_true(v:true) + delfunc Func +endfunc + func Test_function_defined_line() if has('gui_running') " Can't catch the output of gvim. -- cgit From 4edf7b9ff22ca702876a7d0b5534fa2fc16b1897 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 26 Sep 2020 12:03:20 -0400 Subject: vim-patch:8.1.1591: on error garbage collection may free memory in use Problem: On error garbage collection may free memory in use. Solution: Reset may_garbage_collect when evaluating expression mapping. Add tests. (Ozaki Kiichi, closes vim/vim#4579) https://github.com/vim/vim/commit/7d491c425334d9477637372a4ebec64c228c8430 --- src/nvim/testdir/test_vimscript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 3e2e1795dc..cb81997d39 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1409,7 +1409,7 @@ func Test_compound_assignment_operators() let @/ = '' endfunc -func! Test_funccall_garbage_collect() +func Test_funccall_garbage_collect() func Func(x, ...) call add(a:x, a:000) endfunc -- cgit