From: Bram Moolenaar Date: Fri, 12 Jul 2019 18:17:03 +0000 (+0200) Subject: patch 8.1.1671: copying a blob may result in it being locked X-Git-Tag: v8.1.1671 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7b9efbccfe17ee3f7b1bb877b7745d5bfbf0804;p=vim patch 8.1.1671: copying a blob may result in it being locked Problem: Copying a blob may result in it being locked. Solution: Reset v_lock. (Ken Takata, closes #4648) --- diff --git a/src/blob.c b/src/blob.c index cbd26b9f0..fb40a5779 100644 --- a/src/blob.c +++ b/src/blob.c @@ -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) diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim index b01e11be2..273465d53 100644 --- a/src/testdir/test_blob.vim +++ b/src/testdir/test_blob.vim @@ -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() diff --git a/src/version.c b/src/version.c index b5504b187..98259240d 100644 --- a/src/version.c +++ b/src/version.c @@ -777,6 +777,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1671, /**/ 1670, /**/