diff src/vim9execute.c @ 26891:902b8bee5254 v8.2.3974

patch 8.2.3974: Vim9: LISTAPPEND instruction does not check for a locked list Commit: https://github.com/vim/vim/commit/1f4a3457a3e55cdacd70ab0d5be587c248fb1ce8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 1 18:29:21 2022 +0000 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 https://github.com/vim/vim/issues/9452)
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 19:30:03 +0100
parents 7f150a4936f2
children 8796f1384750
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -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);