1
0
forked from aniani/vim

patch 7.4.1715

Problem:    Double free when a partial is in a cycle with a list or dict.
            (Nikolai Pavlov)
Solution:   Do not free a nested list or dict used by the partial.
This commit is contained in:
Bram Moolenaar
2016-04-06 22:59:37 +02:00
parent 54f1b7abf8
commit ddecc25947
3 changed files with 88 additions and 42 deletions

View File

@@ -220,3 +220,21 @@ func Test_bind_in_python()
endtry
endif
endfunc
" This causes double free on exit if EXITFREE is defined.
func Test_cyclic_list_arg()
let l = []
let Pt = function('string', [l])
call add(l, Pt)
unlet l
unlet Pt
endfunc
" This causes double free on exit if EXITFREE is defined.
func Test_cyclic_dict_arg()
let d = {}
let Pt = function('string', [d])
let d.Pt = Pt
unlet d
unlet Pt
endfunc