1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: extend(o, o) may crash Vim.
12 Solution: Fix crash and add test. (Thinca and Hirohito Higashi)
13 Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok
16 *** ../vim-7.3.515/src/eval.c 2012-04-30 17:35:44.000000000 +0200
17 --- src/eval.c 2012-05-18 12:02:44.000000000 +0200
20 EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
23 ! else if (*action == 'f')
25 clear_tv(&di1->di_tv);
26 copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
28 EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
31 ! else if (*action == 'f' && HI2DI(hi2) != di1)
33 clear_tv(&di1->di_tv);
34 copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
35 *** ../vim-7.3.515/src/testdir/test55.in 2010-11-10 20:31:24.000000000 +0100
36 --- src/testdir/test55.in 2012-05-18 11:57:23.000000000 +0200
40 :let dict4copy = deepcopy(dict4)
42 :$put =(dict4 == dict4copy)
44 + :" Pass the same List to extend()
45 + :let l = [1, 2, 3, 4, 5]
49 + :" Pass the same Dict to extend()
50 + :let d = { 'a': {'b': 'B'}}
54 + :" Pass the same Dict to extend() with "error"
56 + : call extend(d, d, "error")
58 + : $put =v:exception[:15] . v:exception[-1:-1]
63 :call Test(1, 2, [3, 4], {5: 6}) " This may take a while
64 *** ../vim-7.3.515/src/testdir/test55.ok 2010-11-10 20:31:24.000000000 +0100
65 --- src/testdir/test55.ok 2012-05-18 11:57:01.000000000 +0200
72 + [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
76 *** ../vim-7.3.515/src/version.c 2012-04-30 21:09:38.000000000 +0200
77 --- src/version.c 2012-05-18 12:04:54.000000000 +0200
81 { /* Add new patch number below this line */
87 I used to wonder about the meaning of life. But I looked it
88 up in the dictionary under "L" and there it was - the meaning
89 of life. It was less than I expected. - Dogbert
91 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
92 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
93 \\\ an exciting new programming language -- http://www.Zimbu.org ///
94 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///