comparison src/list.c @ 23058:77f181975381 v8.2.2075

patch 8.2.2075: error for const argument to mapnew() Commit: https://github.com/vim/vim/commit/57cf4973a283941c92744554474b2c52ce892fd1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 1 21:08:05 2020 +0100 patch 8.2.2075: error for const argument to mapnew() Problem: Error for const argument to mapnew(). Solution: Don't give an error. (closes https://github.com/vim/vim/issues/7400)
author Bram Moolenaar <Bram@vim.org>
date Tue, 01 Dec 2020 21:15:03 +0100
parents 4ba6c5eebb28
children b545334ae654
comparison
equal deleted inserted replaced
23057:35ba3a465deb 23058:77f181975381
2063 int r; 2063 int r;
2064 typval_T newtv; 2064 typval_T newtv;
2065 2065
2066 --todo; 2066 --todo;
2067 di = HI2DI(hi); 2067 di = HI2DI(hi);
2068 if (filtermap != FILTERMAP_FILTER 2068 if (filtermap == FILTERMAP_MAP
2069 && (value_check_lock(di->di_tv.v_lock, 2069 && (value_check_lock(di->di_tv.v_lock,
2070 arg_errmsg, TRUE) 2070 arg_errmsg, TRUE)
2071 || var_check_ro(di->di_flags, 2071 || var_check_ro(di->di_flags,
2072 arg_errmsg, TRUE))) 2072 arg_errmsg, TRUE)))
2073 break; 2073 break;
2223 val += stride; 2223 val += stride;
2224 } 2224 }
2225 } 2225 }
2226 else 2226 else
2227 { 2227 {
2228 // Materialized list from range(): loop over the items 2228 // Materialized list: loop over the items
2229 for (li = l->lv_first; li != NULL; li = nli) 2229 for (li = l->lv_first; li != NULL; li = nli)
2230 { 2230 {
2231 typval_T newtv; 2231 typval_T newtv;
2232 2232
2233 if (filtermap != FILTERMAP_FILTER && value_check_lock( 2233 if (filtermap == FILTERMAP_MAP && value_check_lock(
2234 li->li_tv.v_lock, arg_errmsg, TRUE)) 2234 li->li_tv.v_lock, arg_errmsg, TRUE))
2235 break; 2235 break;
2236 nli = li->li_next; 2236 nli = li->li_next;
2237 set_vim_var_nr(VV_KEY, idx); 2237 set_vim_var_nr(VV_KEY, idx);
2238 if (filter_map_one(&li->li_tv, expr, filtermap, 2238 if (filter_map_one(&li->li_tv, expr, filtermap,