summaryrefslogtreecommitdiff
path: root/src/testdir/test_partial.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-06 22:59:37 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-06 22:59:37 +0200
commitddecc25947dbdd689d5bcaed32f298a08abdd497 (patch)
treea6a666b3e79c37895431f7732a4318b0692aa366 /src/testdir/test_partial.vim
parent54f1b7abf8c48b1dd997202258d1d0673ed4bd29 (diff)
downloadvim-git-ddecc25947dbdd689d5bcaed32f298a08abdd497.tar.gz
patch 7.4.1715v7.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.
Diffstat (limited to 'src/testdir/test_partial.vim')
-rw-r--r--src/testdir/test_partial.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim
index 08958de83..2d53e8207 100644
--- a/src/testdir/test_partial.vim
+++ b/src/testdir/test_partial.vim
@@ -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