0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

updated for version 7.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
This commit is contained in:
Bram Moolenaar
2010-11-10 20:41:57 +01:00
parent a3e7b1f42b
commit 67b3f99eb0
4 changed files with 55 additions and 23 deletions

View File

@@ -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

View File

@@ -109,3 +109,5 @@ caught a:000[3]
1
0
0
1
1