0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

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 #4554, closes #4547)
This commit is contained in:
Bram Moolenaar
2019-06-17 21:18:41 +02:00
parent ad24a71e22
commit 6e5000d493
3 changed files with 26 additions and 15 deletions

View File

@@ -1665,6 +1665,17 @@ func Test_refcount()
delfunc DictFunc
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
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker