comparison src/vim9execute.c @ 27394:69a48bcd1d80 v8.2.4225

patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function Commit: https://github.com/vim/vim/commit/70c43d84be98ab54d3723155dcc4232dc5a5f081 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 26 21:01:15 2022 +0000 patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function Problem: Vim9: depth argument of :lockvar not parsed in :def function. Solution: Parse the optional depth argument. (closes https://github.com/vim/vim/issues/9629) Fix that locking doesn't work for a non-materialize list.
author Bram Moolenaar <Bram@vim.org>
date Wed, 26 Jan 2022 22:15:03 +0100
parents 1a6421c5be20
children f00a7a2bee21
comparison
equal deleted inserted replaced
27393:db7fa549029b 27394:69a48bcd1d80
1752 } 1752 }
1753 if (lidx < list->lv_len) 1753 if (lidx < list->lv_len)
1754 { 1754 {
1755 listitem_T *li = list_find(list, lidx); 1755 listitem_T *li = list_find(list, lidx);
1756 1756
1757 if (error_if_locked(li->li_tv.v_lock, e_cannot_change_list_item)) 1757 if (error_if_locked(li->li_tv.v_lock,
1758 e_cannot_change_locked_list_item))
1758 return FAIL; 1759 return FAIL;
1759 // overwrite existing list item 1760 // overwrite existing list item
1760 clear_tv(&li->li_tv); 1761 clear_tv(&li->li_tv);
1761 li->li_tv = *tv; 1762 li->li_tv = *tv;
1762 } 1763 }
1763 else 1764 else
1764 { 1765 {
1765 if (error_if_locked(list->lv_lock, e_cannot_change_list)) 1766 if (error_if_locked(list->lv_lock, e_cannot_change_locked_list))
1766 return FAIL; 1767 return FAIL;
1767 // append to list, only fails when out of memory 1768 // append to list, only fails when out of memory
1768 if (list_append_tv(list, tv) == FAIL) 1769 if (list_append_tv(list, tv) == FAIL)
1769 return NOTDONE; 1770 return NOTDONE;
1770 clear_tv(tv); 1771 clear_tv(tv);