]> granicus.if.org Git - vim/commitdiff
patch 8.1.1671: copying a blob may result in it being locked v8.1.1671
authorBram Moolenaar <Bram@vim.org>
Fri, 12 Jul 2019 18:17:03 +0000 (20:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 12 Jul 2019 18:17:03 +0000 (20:17 +0200)
Problem:    Copying a blob may result in it being locked.
Solution:   Reset v_lock. (Ken Takata, closes #4648)

src/blob.c
src/testdir/test_blob.vim
src/version.c

index cbd26b9f000a9afbe4478631a35c2ab6657c890a..fb40a5779970aa6dcca7f53314f0e5caed8e2949 100644 (file)
@@ -63,6 +63,7 @@ blob_copy(typval_T *from, typval_T *to)
     int            ret = OK;
 
     to->v_type = VAR_BLOB;
+    to->v_lock = 0;
     if (from->vval.v_blob == NULL)
        to->vval.v_blob = NULL;
     else if (rettv_blob_alloc(to) == FAIL)
index b01e11be229526bc9b0200c928110d2daae898b3..273465d53101a1bf4cd9f3e69b4e8f561e8c67a8 100644 (file)
@@ -71,6 +71,10 @@ func Test_blob_assign()
   call assert_fails('let b .= "xx"', 'E734:')
   call assert_fails('let b += "xx"', 'E734:')
   call assert_fails('let b[1:1] .= 0z55', 'E734:')
+
+  let l = [0z12]
+  let m = deepcopy(l)
+  let m[0] = 0z34      " E742 or E741 should not occur.
 endfunc
 
 func Test_blob_get_range()
index b5504b1870a520e0b52d9215f84e866d93f8fd17..98259240d4d9cef2d3b83d6a83df1aa58a949fb9 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1671,
 /**/
     1670,
 /**/