mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
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:
@@ -2262,6 +2262,7 @@ void tv_blob_copy(typval_T *const from, typval_T *const to)
|
|||||||
assert(from->v_type == VAR_BLOB);
|
assert(from->v_type == VAR_BLOB);
|
||||||
|
|
||||||
to->v_type = VAR_BLOB;
|
to->v_type = VAR_BLOB;
|
||||||
|
to->v_lock = VAR_UNLOCKED;
|
||||||
if (from->vval.v_blob == NULL) {
|
if (from->vval.v_blob == NULL) {
|
||||||
to->vval.v_blob = NULL;
|
to->vval.v_blob = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -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 += "xx"', 'E734:')
|
call assert_fails('let b += "xx"', 'E734:')
|
||||||
call assert_fails('let b[1:1] .= 0z55', '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
|
endfunc
|
||||||
|
|
||||||
func Test_blob_get_range()
|
func Test_blob_get_range()
|
||||||
|
Reference in New Issue
Block a user