0
0
mirror of https://github.com/vim/vim.git synced 2025-11-01 10:07:16 -04:00

updated for version 7.3.516

Problem:    extend(o, o) may crash Vim.
Solution:   Fix crash and add test. (Thinca and Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2012-05-18 12:07:05 +02:00
parent 8071607aa5
commit 2fc8802fcc
4 changed files with 25 additions and 1 deletions

View File

@@ -352,6 +352,24 @@ let l = [0, 1, 2, 3]
:let dict4copy = deepcopy(dict4)
:$put =(l == lcopy)
:$put =(dict4 == dict4copy)
:"
:" Pass the same List to extend()
:let l = [1, 2, 3, 4, 5]
:call extend(l, l)
:$put =string(l)
:"
:" Pass the same Dict to extend()
:let d = { 'a': {'b': 'B'}}
:call extend(d, d)
:$put =string(d)
:"
:" Pass the same Dict to extend() with "error"
:try
: call extend(d, d, "error")
:catch
: $put =v:exception[:15] . v:exception[-1:-1]
:endtry
:$put =string(d)
:endfun
:"
:call Test(1, 2, [3, 4], {5: 6}) " This may take a while

View File

@@ -111,3 +111,7 @@ caught a:000[3]
0
1
1
[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
{'a': {'b': 'B'}}
Vim(call):E737: a
{'a': {'b': 'B'}}