Mercurial > vim
comparison src/testdir/test_vimscript.vim @ 17127:d244a9be99db v8.1.1563
patch 8.1.1563: crash when using closures
commit https://github.com/vim/vim/commit/6e5000d493b4f385f901eb97f3ce0c8088373403
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 17 21:18:41 2019 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 17 Jun 2019 21:30:08 +0200 |
parents | b55b4a21f006 |
children | a5c3d374e1d3 |
comparison
equal
deleted
inserted
replaced
17126:e35620f6d395 | 17127:d244a9be99db |
---|---|
1663 call d.Func() | 1663 call d.Func() |
1664 unlet d | 1664 unlet d |
1665 delfunc DictFunc | 1665 delfunc DictFunc |
1666 endfunc | 1666 endfunc |
1667 | 1667 |
1668 func! Test_funccall_garbage_collect() | |
1669 func Func(x, ...) | |
1670 call add(a:x, a:000) | |
1671 endfunc | |
1672 call Func([], []) | |
1673 " Must not crash cause by invalid freeing | |
1674 call test_garbagecollect_now() | |
1675 call assert_true(v:true) | |
1676 delfunc Func | |
1677 endfunc | |
1678 | |
1668 "------------------------------------------------------------------------------- | 1679 "------------------------------------------------------------------------------- |
1669 " Modelines {{{1 | 1680 " Modelines {{{1 |
1670 " vim: ts=8 sw=4 tw=80 fdm=marker | 1681 " vim: ts=8 sw=4 tw=80 fdm=marker |
1671 "------------------------------------------------------------------------------- | 1682 "------------------------------------------------------------------------------- |