comparison src/list.c @ 26937:7045e9308ca3 v8.2.3997

patch 8.2.3997: Vim9: not enough testing for extend() and map() Commit: https://github.com/vim/vim/commit/10d6f18b2f9090d19dd884827c4be59a20b446bf Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 4 15:54:38 2022 +0000 patch 8.2.3997: Vim9: not enough testing for extend() and map() Problem: Vim9: not enough testing for extend() and map(). Solution: Add more test cases. Fix uncovered problems. Remove unused type fields.
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Jan 2022 17:00:04 +0100
parents ccb9be1cdd71
children b34ddbca305c
comparison
equal deleted inserted replaced
26936:6b6a26145714 26937:7045e9308ca3
269 l->lv_used_prev->lv_used_next = l->lv_used_next; 269 l->lv_used_prev->lv_used_next = l->lv_used_next;
270 if (l->lv_used_next != NULL) 270 if (l->lv_used_next != NULL)
271 l->lv_used_next->lv_used_prev = l->lv_used_prev; 271 l->lv_used_next->lv_used_prev = l->lv_used_prev;
272 272
273 free_type(l->lv_type); 273 free_type(l->lv_type);
274 free_type(l->lv_decl_type);
275 vim_free(l); 274 vim_free(l);
276 } 275 }
277 276
278 void 277 void
279 list_free_items(int copyID) 278 list_free_items(int copyID)
1024 if (l == NULL) 1023 if (l == NULL)
1025 return; 1024 return;
1026 // The type will change. 1025 // The type will change.
1027 free_type(l->lv_type); 1026 free_type(l->lv_type);
1028 l->lv_type = NULL; 1027 l->lv_type = NULL;
1029 free_type(l->lv_decl_type);
1030 l->lv_decl_type = NULL;
1031 } 1028 }
1032 else 1029 else
1033 { 1030 {
1034 if (value_check_lock(l->lv_lock, 1031 if (value_check_lock(l->lv_lock,
1035 (char_u *)N_("flatten() argument"), TRUE)) 1032 (char_u *)N_("flatten() argument"), TRUE))
1221 1218
1222 copy = list_alloc(); 1219 copy = list_alloc();
1223 if (copy != NULL) 1220 if (copy != NULL)
1224 { 1221 {
1225 copy->lv_type = alloc_type(orig->lv_type); 1222 copy->lv_type = alloc_type(orig->lv_type);
1226 copy->lv_decl_type = alloc_type(orig->lv_decl_type);
1227 if (copyID != 0) 1223 if (copyID != 0)
1228 { 1224 {
1229 // Do this before adding the items, because one of the items may 1225 // Do this before adding the items, because one of the items may
1230 // refer back to this list. 1226 // refer back to this list.
1231 orig->lv_copyID = copyID; 1227 orig->lv_copyID = copyID;