Mercurial > vim
comparison src/structs.h @ 23458:d2b1269c2c68 v8.2.2272
patch 8.2.2272: Vim9: extend() can violate the type of a variable
Commit: https://github.com/vim/vim/commit/aa210a3aeccc33c6051978017959126b037f94af
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 15:41:03 2021 +0100
patch 8.2.2272: Vim9: extend() can violate the type of a variable
Problem: Vim9: extend() can violate the type of a variable.
Solution: Add the type to the dictionary or list and check items against it.
(closes #7593)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 02 Jan 2021 15:45:04 +0100 |
parents | 40f824f5c7c7 |
children | bb29b09902d5 |
comparison
equal
deleted
inserted
replaced
23457:86b9697a8c63 | 23458:d2b1269c2c68 |
---|---|
1479 listitem_T *lv_last; // last item, NULL if none | 1479 listitem_T *lv_last; // last item, NULL if none |
1480 listitem_T *lv_idx_item; // when not NULL item at index "lv_idx" | 1480 listitem_T *lv_idx_item; // when not NULL item at index "lv_idx" |
1481 int lv_idx; // cached index of an item | 1481 int lv_idx; // cached index of an item |
1482 } mat; | 1482 } mat; |
1483 } lv_u; | 1483 } lv_u; |
1484 type_T *lv_type; // allocated by alloc_type() | |
1484 list_T *lv_copylist; // copied list used by deepcopy() | 1485 list_T *lv_copylist; // copied list used by deepcopy() |
1485 list_T *lv_used_next; // next list in used lists list | 1486 list_T *lv_used_next; // next list in used lists list |
1486 list_T *lv_used_prev; // previous list in used lists list | 1487 list_T *lv_used_prev; // previous list in used lists list |
1487 int lv_refcount; // reference count | 1488 int lv_refcount; // reference count |
1488 int lv_len; // number of items | 1489 int lv_len; // number of items |
1542 char dv_lock; // zero, VAR_LOCKED, VAR_FIXED | 1543 char dv_lock; // zero, VAR_LOCKED, VAR_FIXED |
1543 char dv_scope; // zero, VAR_SCOPE, VAR_DEF_SCOPE | 1544 char dv_scope; // zero, VAR_SCOPE, VAR_DEF_SCOPE |
1544 int dv_refcount; // reference count | 1545 int dv_refcount; // reference count |
1545 int dv_copyID; // ID used by deepcopy() | 1546 int dv_copyID; // ID used by deepcopy() |
1546 hashtab_T dv_hashtab; // hashtab that refers to the items | 1547 hashtab_T dv_hashtab; // hashtab that refers to the items |
1548 type_T *dv_type; // allocated by alloc_type() | |
1547 dict_T *dv_copydict; // copied dict used by deepcopy() | 1549 dict_T *dv_copydict; // copied dict used by deepcopy() |
1548 dict_T *dv_used_next; // next dict in used dicts list | 1550 dict_T *dv_used_next; // next dict in used dicts list |
1549 dict_T *dv_used_prev; // previous dict in used dicts list | 1551 dict_T *dv_used_prev; // previous dict in used dicts list |
1550 }; | 1552 }; |
1551 | 1553 |