diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-11-10 20:41:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-11-10 20:41:57 +0100 |
commit | 67b3f99eb0f4b2014316c7f0152cefc4d6cfc765 (patch) | |
tree | d84b58b0efc20ef43827d37c9fd55728f53fc84a /src/testdir | |
parent | a3e7b1f42b3d91de6f3e5f01d8067cf0079be56c (diff) | |
download | vim-git-67b3f99eb0f4b2014316c7f0152cefc4d6cfc765.tar.gz |
updated for version 7.3.055v7.3.055
Problem: Recursively nested lists and dictionaries cause a near-endless
loop when comparing them with a copy. (ZyX)
Solution: Limit recursiveness in a way that non-recursive structures can
still be nested very deep.
Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test55.in | 11 | ||||
-rw-r--r-- | src/testdir/test55.ok | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test55.in b/src/testdir/test55.in index 7d0008e7e..0cac34866 100644 --- a/src/testdir/test55.in +++ b/src/testdir/test55.in @@ -342,7 +342,18 @@ let l = [0, 1, 2, 3] :$put =(d == d) :$put =(l != deepcopy(l)) :$put =(d != deepcopy(d)) +:" +:" compare complex recursively linked list and dict +:let l = [] +:call add(l, l) +:let dict4 = {"l": l} +:call add(dict4.l, dict4) +:let lcopy = deepcopy(l) +:let dict4copy = deepcopy(dict4) +:$put =(l == lcopy) +:$put =(dict4 == dict4copy) :endfun +:" :call Test(1, 2, [3, 4], {5: 6}) " This may take a while :" :delfunc Test diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok index da8300290..6e402354a 100644 --- a/src/testdir/test55.ok +++ b/src/testdir/test55.ok @@ -109,3 +109,5 @@ caught a:000[3] 1 0 0 +1 +1 |