]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.516 v7.3.516
authorBram Moolenaar <Bram@vim.org>
Fri, 18 May 2012 10:07:05 +0000 (12:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 18 May 2012 10:07:05 +0000 (12:07 +0200)
Problem:    extend(o, o) may crash Vim.
Solution:   Fix crash and add test. (Thinca and Hirohito Higashi)

src/eval.c
src/testdir/test55.in
src/testdir/test55.ok
src/version.c

index fa9966e7ee562a15c61d04e03f9ea92872e13a32..9a81b4f22b412d2618ab1f26791db03b16e8639c 100644 (file)
@@ -10191,7 +10191,7 @@ f_extend(argvars, rettv)
                        EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
                        break;
                    }
-                   else if (*action == 'f')
+                   else if (*action == 'f' && HI2DI(hi2) != di1)
                    {
                        clear_tv(&di1->di_tv);
                        copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
index 0cac34866519c6b5dab73673f412a7c470692887..cf85f57a6c4434f51fe9232e92736db0990627a0 100644 (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
index 6e402354aa9c152dcf406a6416aae2f0a6e6ec68..fde085ce76ac92a8f5c6a339985072807a258db7 100644 (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'}}
index 317a2d19eabdf166320dda5b44cf9dcb702e47c9..5b4bbfc3e714a0923f5fc180e7ca274c0ee850f2 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    516,
 /**/
     515,
 /**/