0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3974: Vim9: LISTAPPEND instruction does not check for a locked list

Problem:    Vim9: LISTAPPEND instruction does not check for a locked list.
Solution:   Check whether the list is locked. (closes #9452)
This commit is contained in:
Bram Moolenaar
2022-01-01 18:29:21 +00:00
parent 0f7a5e758c
commit 1f4a3457a3
3 changed files with 16 additions and 1 deletions

View File

@@ -3911,12 +3911,14 @@ exec_instructions(ectx_T *ectx)
list_T *l = tv1->vval.v_list;
// add an item to a list
SOURCING_LNUM = iptr->isn_lnum;
if (l == NULL)
{
SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_cannot_add_to_null_list));
goto on_error;
}
if (value_check_lock(l->lv_lock, NULL, FALSE))
goto on_error;
if (list_append_tv(l, tv2) == FAIL)
goto theend;
clear_tv(tv2);