Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
26890:453f8cb05fab | 26891:902b8bee5254 |
---|---|
3909 typval_T *tv1 = STACK_TV_BOT(-2); | 3909 typval_T *tv1 = STACK_TV_BOT(-2); |
3910 typval_T *tv2 = STACK_TV_BOT(-1); | 3910 typval_T *tv2 = STACK_TV_BOT(-1); |
3911 list_T *l = tv1->vval.v_list; | 3911 list_T *l = tv1->vval.v_list; |
3912 | 3912 |
3913 // add an item to a list | 3913 // add an item to a list |
3914 SOURCING_LNUM = iptr->isn_lnum; | |
3914 if (l == NULL) | 3915 if (l == NULL) |
3915 { | 3916 { |
3916 SOURCING_LNUM = iptr->isn_lnum; | |
3917 emsg(_(e_cannot_add_to_null_list)); | 3917 emsg(_(e_cannot_add_to_null_list)); |
3918 goto on_error; | 3918 goto on_error; |
3919 } | 3919 } |
3920 if (value_check_lock(l->lv_lock, NULL, FALSE)) | |
3921 goto on_error; | |
3920 if (list_append_tv(l, tv2) == FAIL) | 3922 if (list_append_tv(l, tv2) == FAIL) |
3921 goto theend; | 3923 goto theend; |
3922 clear_tv(tv2); | 3924 clear_tv(tv2); |
3923 --ectx->ec_stack.ga_len; | 3925 --ectx->ec_stack.ga_len; |
3924 } | 3926 } |