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:
@@ -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
|
||||
|
Reference in New Issue
Block a user