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 vim/vim#4648)
b7b9efbccf
This commit is contained in:
Sean Dewar
2021-07-29 21:06:12 +01:00
parent e7772c051f
commit 726b255288
2 changed files with 5 additions and 0 deletions

View File

@@ -2262,6 +2262,7 @@ void tv_blob_copy(typval_T *const from, typval_T *const to)
assert(from->v_type == VAR_BLOB);
to->v_type = VAR_BLOB;
to->v_lock = VAR_UNLOCKED;
if (from->vval.v_blob == NULL) {
to->vval.v_blob = NULL;
} else {

View 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()