To: vim_dev@googlegroups.com Subject: Patch 8.2.0173 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0173 Problem: Build fails with old compiler. Solution: Do not use anonymous unions. (John Marriott) Files: src/vim9compile.c, src/evalvars.c, src/list.c, src/structs.h, src/evalfunc.c, src/channel.c, src/if_mzsch.c, src/if_py_both.h *** ../vim-8.2.0172/src/vim9compile.c 2020-01-28 23:04:02.052967834 +0100 --- src/vim9compile.c 2020-01-29 20:49:02.901530520 +0100 *************** *** 88,94 **** whilescope_T se_while; forscope_T se_for; tryscope_T se_try; ! }; }; /* --- 88,94 ---- whilescope_T se_while; forscope_T se_for; tryscope_T se_try; ! } se_u; }; /* *************** *** 3506,3512 **** return NULL; // "where" is set when ":elseif", "else" or ":endif" is found ! scope->se_if.is_if_label = instr->ga_len; generate_JUMP(cctx, JUMP_IF_FALSE, 0); return p; --- 3506,3512 ---- return NULL; // "where" is set when ":elseif", "else" or ":endif" is found ! scope->se_u.se_if.is_if_label = instr->ga_len; generate_JUMP(cctx, JUMP_IF_FALSE, 0); return p; *************** *** 3528,3539 **** cctx->ctx_locals.ga_len = scope->se_local_count; // jump from previous block to the end ! if (compile_jump_to_end(&scope->se_if.is_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; // compile "expr" --- 3528,3539 ---- cctx->ctx_locals.ga_len = scope->se_local_count; // jump from previous block to the end ! if (compile_jump_to_end(&scope->se_u.se_if.is_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; // compile "expr" *************** *** 3541,3547 **** return NULL; // "where" is set when ":elseif", "else" or ":endif" is found ! scope->se_if.is_if_label = instr->ga_len; generate_JUMP(cctx, JUMP_IF_FALSE, 0); return p; --- 3541,3547 ---- return NULL; // "where" is set when ":elseif", "else" or ":endif" is found ! scope->se_u.se_if.is_if_label = instr->ga_len; generate_JUMP(cctx, JUMP_IF_FALSE, 0); return p; *************** *** 3563,3574 **** cctx->ctx_locals.ga_len = scope->se_local_count; // jump from previous block to the end ! if (compile_jump_to_end(&scope->se_if.is_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; return p; --- 3563,3574 ---- cctx->ctx_locals.ga_len = scope->se_local_count; // jump from previous block to the end ! if (compile_jump_to_end(&scope->se_u.se_if.is_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; return p; *************** *** 3587,3598 **** emsg(_(e_endif_without_if)); return NULL; } ! ifscope = &scope->se_if; cctx->ctx_scope = scope->se_outer; cctx->ctx_locals.ga_len = scope->se_local_count; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; // Fill in the "end" label in jumps at the end of the blocks. --- 3587,3598 ---- emsg(_(e_endif_without_if)); return NULL; } ! ifscope = &scope->se_u.se_if; cctx->ctx_scope = scope->se_outer; cctx->ctx_locals.ga_len = scope->se_local_count; // previous "if" or "elseif" jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; isn->isn_arg.jump.jump_where = instr->ga_len; // Fill in the "end" label in jumps at the end of the blocks. *************** *** 3688,3694 **** } // "for_end" is set when ":endfor" is found ! scope->se_for.fs_top_label = instr->ga_len; generate_FOR(cctx, loop_idx); generate_STORE(cctx, ISN_STORE, var_idx, NULL); --- 3688,3694 ---- } // "for_end" is set when ":endfor" is found ! scope->se_u.se_for.fs_top_label = instr->ga_len; generate_FOR(cctx, loop_idx); generate_STORE(cctx, ISN_STORE, var_idx, NULL); *************** *** 3712,3718 **** emsg(_(e_for)); return NULL; } ! forscope = &scope->se_for; cctx->ctx_scope = scope->se_outer; cctx->ctx_locals.ga_len = scope->se_local_count; --- 3712,3718 ---- emsg(_(e_for)); return NULL; } ! forscope = &scope->se_u.se_for; cctx->ctx_scope = scope->se_outer; cctx->ctx_locals.ga_len = scope->se_local_count; *************** *** 3757,3770 **** if (scope == NULL) return NULL; ! scope->se_while.ws_top_label = instr->ga_len; // compile "expr" if (compile_expr1(&p, cctx) == FAIL) return NULL; // "while_end" is set when ":endwhile" is found ! if (compile_jump_to_end(&scope->se_while.ws_end_label, JUMP_IF_FALSE, cctx) == FAIL) return FAIL; --- 3757,3770 ---- if (scope == NULL) return NULL; ! scope->se_u.se_while.ws_top_label = instr->ga_len; // compile "expr" if (compile_expr1(&p, cctx) == FAIL) return NULL; // "while_end" is set when ":endwhile" is found ! if (compile_jump_to_end(&scope->se_u.se_while.ws_end_label, JUMP_IF_FALSE, cctx) == FAIL) return FAIL; *************** *** 3788,3798 **** cctx->ctx_locals.ga_len = scope->se_local_count; // At end of ":for" scope jump back to the FOR instruction. ! generate_JUMP(cctx, JUMP_ALWAYS, scope->se_while.ws_top_label); // Fill in the "end" label in the WHILE statement so it can jump here. // And in any jumps for ":break" ! compile_fill_jump_to_end(&scope->se_while.ws_end_label, cctx); vim_free(scope); --- 3788,3798 ---- cctx->ctx_locals.ga_len = scope->se_local_count; // At end of ":for" scope jump back to the FOR instruction. ! generate_JUMP(cctx, JUMP_ALWAYS, scope->se_u.se_while.ws_top_label); // Fill in the "end" label in the WHILE statement so it can jump here. // And in any jumps for ":break" ! compile_fill_jump_to_end(&scope->se_u.se_while.ws_end_label, cctx); vim_free(scope); *************** *** 3821,3828 **** // Jump back to the FOR or WHILE instruction. generate_JUMP(cctx, JUMP_ALWAYS, ! scope->se_type == FOR_SCOPE ? scope->se_for.fs_top_label ! : scope->se_while.ws_top_label); return arg; } --- 3821,3828 ---- // Jump back to the FOR or WHILE instruction. generate_JUMP(cctx, JUMP_ALWAYS, ! scope->se_type == FOR_SCOPE ? scope->se_u.se_for.fs_top_label ! : scope->se_u.se_while.ws_top_label); return arg; } *************** *** 3849,3857 **** // Jump to the end of the FOR or WHILE loop. if (scope->se_type == FOR_SCOPE) ! el = &scope->se_for.fs_end_label; else ! el = &scope->se_while.ws_end_label; if (compile_jump_to_end(el, JUMP_ALWAYS, cctx) == FAIL) return FAIL; --- 3849,3857 ---- // Jump to the end of the FOR or WHILE loop. if (scope->se_type == FOR_SCOPE) ! el = &scope->se_u.se_for.fs_end_label; else ! el = &scope->se_u.se_while.ws_end_label; if (compile_jump_to_end(el, JUMP_ALWAYS, cctx) == FAIL) return FAIL; *************** *** 3928,3934 **** // "catch" is set when the first ":catch" is found. // "finally" is set when ":finally" or ":endtry" is found ! try_scope->se_try.ts_try_label = instr->ga_len; if (generate_instr(cctx, ISN_TRY) == NULL) return NULL; --- 3928,3934 ---- // "catch" is set when the first ":catch" is found. // "finally" is set when ":finally" or ":endtry" is found ! try_scope->se_u.se_try.ts_try_label = instr->ga_len; if (generate_instr(cctx, ISN_TRY) == NULL) return NULL; *************** *** 3963,3995 **** return NULL; } ! if (scope->se_try.ts_caught_all) { emsg(_("E1033: catch unreachable after catch-all")); return NULL; } // Jump from end of previous block to :finally or :endtry ! if (compile_jump_to_end(&scope->se_try.ts_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // End :try or :catch scope: set value in ISN_TRY instruction ! isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; if (isn->isn_arg.try.try_catch == 0) isn->isn_arg.try.try_catch = instr->ga_len; ! if (scope->se_try.ts_catch_label != 0) { // Previous catch without match jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_catch_label; isn->isn_arg.jump.jump_where = instr->ga_len; } p = skipwhite(arg); if (ends_excmd(*p)) { ! scope->se_try.ts_caught_all = TRUE; ! scope->se_try.ts_catch_label = 0; } else { --- 3963,3995 ---- return NULL; } ! if (scope->se_u.se_try.ts_caught_all) { emsg(_("E1033: catch unreachable after catch-all")); return NULL; } // Jump from end of previous block to :finally or :endtry ! if (compile_jump_to_end(&scope->se_u.se_try.ts_end_label, JUMP_ALWAYS, cctx) == FAIL) return NULL; // End :try or :catch scope: set value in ISN_TRY instruction ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; if (isn->isn_arg.try.try_catch == 0) isn->isn_arg.try.try_catch = instr->ga_len; ! if (scope->se_u.se_try.ts_catch_label != 0) { // Previous catch without match jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label; isn->isn_arg.jump.jump_where = instr->ga_len; } p = skipwhite(arg); if (ends_excmd(*p)) { ! scope->se_u.se_try.ts_caught_all = TRUE; ! scope->se_u.se_try.ts_catch_label = 0; } else { *************** *** 4003,4009 **** if (generate_COMPARE(cctx, EXPR_MATCH, FALSE) == FAIL) return NULL; ! scope->se_try.ts_catch_label = instr->ga_len; if (generate_JUMP(cctx, JUMP_IF_FALSE, 0) == FAIL) return NULL; } --- 4003,4009 ---- if (generate_COMPARE(cctx, EXPR_MATCH, FALSE) == FAIL) return NULL; ! scope->se_u.se_try.ts_catch_label = instr->ga_len; if (generate_JUMP(cctx, JUMP_IF_FALSE, 0) == FAIL) return NULL; } *************** *** 4036,4042 **** } // End :catch or :finally scope: set value in ISN_TRY instruction ! isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; if (isn->isn_arg.try.try_finally != 0) { emsg(_(e_finally_dup)); --- 4036,4042 ---- } // End :catch or :finally scope: set value in ISN_TRY instruction ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; if (isn->isn_arg.try.try_finally != 0) { emsg(_(e_finally_dup)); *************** *** 4044,4055 **** } // Fill in the "end" label in jumps at the end of the blocks. ! compile_fill_jump_to_end(&scope->se_try.ts_end_label, cctx); ! if (scope->se_try.ts_catch_label != 0) { // Previous catch without match jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_catch_label; isn->isn_arg.jump.jump_where = instr->ga_len; } --- 4044,4055 ---- } // Fill in the "end" label in jumps at the end of the blocks. ! compile_fill_jump_to_end(&scope->se_u.se_try.ts_end_label, cctx); ! if (scope->se_u.se_try.ts_catch_label != 0) { // Previous catch without match jumps here ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label; isn->isn_arg.jump.jump_where = instr->ga_len; } *************** *** 4085,4091 **** return NULL; } ! isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; if (isn->isn_arg.try.try_catch == 0 && isn->isn_arg.try.try_finally == 0) { emsg(_("E1032: missing :catch or :finally")); --- 4085,4091 ---- return NULL; } ! isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; if (isn->isn_arg.try.try_catch == 0 && isn->isn_arg.try.try_finally == 0) { emsg(_("E1032: missing :catch or :finally")); *************** *** 4094,4100 **** // Fill in the "end" label in jumps at the end of the blocks, if not done // by ":finally". ! compile_fill_jump_to_end(&scope->se_try.ts_end_label, cctx); // End :catch or :finally scope: set value in ISN_TRY instruction if (isn->isn_arg.try.try_finally == 0) --- 4094,4100 ---- // Fill in the "end" label in jumps at the end of the blocks, if not done // by ":finally". ! compile_fill_jump_to_end(&scope->se_u.se_try.ts_end_label, cctx); // End :catch or :finally scope: set value in ISN_TRY instruction if (isn->isn_arg.try.try_finally == 0) *** ../vim-8.2.0172/src/evalvars.c 2020-01-27 22:09:35.796838619 +0100 --- src/evalvars.c 2020-01-29 20:54:16.367984960 +0100 *************** *** 2128,2134 **** { if (list_append_string(l, (char_u *)argv[i], -1) == FAIL) getout(1); ! l->lv_last->li_tv.v_lock = VAR_FIXED; } set_vim_var_list(VV_ARGV, l); } --- 2128,2134 ---- { if (list_append_string(l, (char_u *)argv[i], -1) == FAIL) getout(1); ! l->lv_u.mat.lv_last->li_tv.v_lock = VAR_FIXED; } set_vim_var_list(VV_ARGV, l); } *** ../vim-8.2.0172/src/list.c 2020-01-27 22:37:18.997636228 +0100 --- src/list.c 2020-01-29 21:04:39.375791879 +0100 *************** *** 126,132 **** l->lv_len = count; l->lv_with_items = count; l->lv_first = li; ! l->lv_last = li + count - 1; for (i = 0; i < count; ++i) { if (i == 0) --- 126,132 ---- l->lv_len = count; l->lv_with_items = count; l->lv_first = li; ! l->lv_u.mat.lv_last = li + count - 1; for (i = 0; i < count; ++i) { if (i == 0) *************** *** 406,430 **** range_list_materialize(l); // When there is a cached index may start search from there. ! if (l->lv_idx_item != NULL) { ! if (n < l->lv_idx / 2) { // closest to the start of the list item = l->lv_first; idx = 0; } ! else if (n > (l->lv_idx + l->lv_len) / 2) { // closest to the end of the list ! item = l->lv_last; idx = l->lv_len - 1; } else { // closest to the cached index ! item = l->lv_idx_item; ! idx = l->lv_idx; } } else --- 406,430 ---- range_list_materialize(l); // When there is a cached index may start search from there. ! if (l->lv_u.mat.lv_idx_item != NULL) { ! if (n < l->lv_u.mat.lv_idx / 2) { // closest to the start of the list item = l->lv_first; idx = 0; } ! else if (n > (l->lv_u.mat.lv_idx + l->lv_len) / 2) { // closest to the end of the list ! item = l->lv_u.mat.lv_last; idx = l->lv_len - 1; } else { // closest to the cached index ! item = l->lv_u.mat.lv_idx_item; ! idx = l->lv_u.mat.lv_idx; } } else *************** *** 438,444 **** else { // closest to the end of the list ! item = l->lv_last; idx = l->lv_len - 1; } } --- 438,444 ---- else { // closest to the end of the list ! item = l->lv_u.mat.lv_last; idx = l->lv_len - 1; } } *************** *** 457,464 **** } // cache the used index ! l->lv_idx = idx; ! l->lv_idx_item = item; return item; } --- 457,464 ---- } // cache the used index ! l->lv_u.mat.lv_idx = idx; ! l->lv_u.mat.lv_idx_item = item; return item; } *************** *** 491,497 **** return -1L; } ! return l->lv_start + n * l->lv_stride; } li = list_find(l, idx); --- 491,497 ---- return -1L; } ! return l->lv_u.nonmat.lv_start + n * l->lv_u.nonmat.lv_stride; } li = list_find(l, idx); *************** *** 549,566 **** list_append(list_T *l, listitem_T *item) { range_list_materialize(l); ! if (l->lv_last == NULL) { // empty list l->lv_first = item; ! l->lv_last = item; item->li_prev = NULL; } else { ! l->lv_last->li_next = item; ! item->li_prev = l->lv_last; ! l->lv_last = item; } ++l->lv_len; item->li_next = NULL; --- 549,566 ---- list_append(list_T *l, listitem_T *item) { range_list_materialize(l); ! if (l->lv_u.mat.lv_last == NULL) { // empty list l->lv_first = item; ! l->lv_u.mat.lv_last = item; item->li_prev = NULL; } else { ! l->lv_u.mat.lv_last->li_next = item; ! item->li_prev = l->lv_u.mat.lv_last; ! l->lv_u.mat.lv_last = item; } ++l->lv_len; item->li_next = NULL; *************** *** 710,721 **** if (item->li_prev == NULL) { l->lv_first = ni; ! ++l->lv_idx; } else { item->li_prev->li_next = ni; ! l->lv_idx_item = NULL; } item->li_prev = ni; ++l->lv_len; --- 710,721 ---- if (item->li_prev == NULL) { l->lv_first = ni; ! ++l->lv_u.mat.lv_idx; } else { item->li_prev->li_next = ni; ! l->lv_u.mat.lv_idx_item = NULL; } item->li_prev = ni; ++l->lv_len; *************** *** 846,859 **** } if (item2->li_next == NULL) ! l->lv_last = item->li_prev; else item2->li_next->li_prev = item->li_prev; if (item->li_prev == NULL) l->lv_first = item2->li_next; else item->li_prev->li_next = item2->li_next; ! l->lv_idx_item = NULL; } /* --- 846,859 ---- } if (item2->li_next == NULL) ! l->lv_u.mat.lv_last = item->li_prev; else item2->li_next->li_prev = item->li_prev; if (item->li_prev == NULL) l->lv_first = item2->li_next; else item->li_prev->li_next = item2->li_next; ! l->lv_u.mat.lv_idx_item = NULL; } /* *************** *** 1149,1155 **** memset(sl, 0, sizeof(staticList10_T)); l->lv_first = &sl->sl_items[0]; ! l->lv_last = &sl->sl_items[9]; l->lv_refcount = DO_NOT_FREE_CNT; l->lv_lock = VAR_FIXED; sl->sl_list.lv_len = 10; --- 1149,1155 ---- memset(sl, 0, sizeof(staticList10_T)); l->lv_first = &sl->sl_items[0]; ! l->lv_u.mat.lv_last = &sl->sl_items[9]; l->lv_refcount = DO_NOT_FREE_CNT; l->lv_lock = VAR_FIXED; sl->sl_list.lv_len = 10; *************** *** 1280,1286 **** { l = rettv->vval.v_list; l->lv_first = item; ! l->lv_last = item2; item->li_prev = NULL; item2->li_next = NULL; l->lv_len = cnt; --- 1280,1286 ---- { l = rettv->vval.v_list; l->lv_first = item; ! l->lv_u.mat.lv_last = item2; item->li_prev = NULL; item2->li_next = NULL; l->lv_len = cnt; *************** *** 1605,1611 **** if (!info.item_compare_func_err) { // Clear the List and append the items in sorted order. ! l->lv_first = l->lv_last = l->lv_idx_item = NULL; l->lv_len = 0; for (i = 0; i < len; ++i) list_append(l, ptrs[i].item); --- 1605,1612 ---- if (!info.item_compare_func_err) { // Clear the List and append the items in sorted order. ! l->lv_first = l->lv_u.mat.lv_last ! = l->lv_u.mat.lv_idx_item = NULL; l->lv_len = 0; for (i = 0; i < len; ++i) list_append(l, ptrs[i].item); *************** *** 1645,1651 **** if (li->li_next != NULL) li->li_next->li_prev = ptrs[i].item; else ! l->lv_last = ptrs[i].item; list_fix_watch(l, li); listitem_free(l, li); l->lv_len--; --- 1646,1652 ---- if (li->li_next != NULL) li->li_next->li_prev = ptrs[i].item; else ! l->lv_u.mat.lv_last = ptrs[i].item; list_fix_watch(l, li); listitem_free(l, li); l->lv_len--; *************** *** 2259,2274 **** { if (l->lv_first == &range_list_item) { ! varnumber_T new_start = l->lv_start ! + (l->lv_len - 1) * l->lv_stride; ! l->lv_end = new_start - (l->lv_end - l->lv_start); ! l->lv_start = new_start; ! l->lv_stride = -l->lv_stride; rettv_list_set(rettv, l); return; } ! li = l->lv_last; ! l->lv_first = l->lv_last = NULL; l->lv_len = 0; while (li != NULL) { --- 2260,2276 ---- { if (l->lv_first == &range_list_item) { ! varnumber_T new_start = l->lv_u.nonmat.lv_start ! + (l->lv_len - 1) * l->lv_u.nonmat.lv_stride; ! l->lv_u.nonmat.lv_end = new_start ! - (l->lv_u.nonmat.lv_end - l->lv_u.nonmat.lv_start); ! l->lv_u.nonmat.lv_start = new_start; ! l->lv_u.nonmat.lv_stride = -l->lv_u.nonmat.lv_stride; rettv_list_set(rettv, l); return; } ! li = l->lv_u.mat.lv_last; ! l->lv_first = l->lv_u.mat.lv_last = NULL; l->lv_len = 0; while (li != NULL) { *************** *** 2277,2283 **** li = ni; } rettv_list_set(rettv, l); ! l->lv_idx = l->lv_len - l->lv_idx - 1; } } --- 2279,2285 ---- li = ni; } rettv_list_set(rettv, l); ! l->lv_u.mat.lv_idx = l->lv_len - l->lv_u.mat.lv_idx - 1; } } *** ../vim-8.2.0172/src/structs.h 2020-01-26 17:38:07.824360503 +0100 --- src/structs.h 2020-01-29 20:56:34.131310380 +0100 *************** *** 1410,1422 **** varnumber_T lv_start; varnumber_T lv_end; int lv_stride; ! }; struct { // used for materialized list listitem_T *lv_last; // last item, NULL if none listitem_T *lv_idx_item; // when not NULL item at index "lv_idx" int lv_idx; // cached index of an item ! }; ! }; list_T *lv_copylist; // copied list used by deepcopy() list_T *lv_used_next; // next list in used lists list list_T *lv_used_prev; // previous list in used lists list --- 1410,1422 ---- varnumber_T lv_start; varnumber_T lv_end; int lv_stride; ! } nonmat; struct { // used for materialized list listitem_T *lv_last; // last item, NULL if none listitem_T *lv_idx_item; // when not NULL item at index "lv_idx" int lv_idx; // cached index of an item ! } mat; ! } lv_u; list_T *lv_copylist; // copied list used by deepcopy() list_T *lv_used_next; // next list in used lists list list_T *lv_used_prev; // previous list in used lists list *** ../vim-8.2.0172/src/evalfunc.c 2020-01-27 22:09:35.796838619 +0100 --- src/evalfunc.c 2020-01-29 20:59:32.454439967 +0100 *************** *** 4070,4076 **** // Start at specified item. Use the cached index that list_find() // sets, so that a negative number also works. item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error)); ! idx = l->lv_idx; if (argvars[3].v_type != VAR_UNKNOWN) ic = (int)tv_get_number_chk(&argvars[3], &error); if (error) --- 4070,4076 ---- // Start at specified item. Use the cached index that list_find() // sets, so that a negative number also works. item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error)); ! idx = l->lv_u.mat.lv_idx; if (argvars[3].v_type != VAR_UNKNOWN) ic = (int)tv_get_number_chk(&argvars[3], &error); if (error) *************** *** 4678,4684 **** li = list_find(l, start); if (li == NULL) goto theend; ! idx = l->lv_idx; // use the cached index } else { --- 4678,4684 ---- li = list_find(l, start); if (li == NULL) goto theend; ! idx = l->lv_u.mat.lv_idx; // use the cached index } else { *************** *** 5330,5338 **** // works with ":for". If used otherwise range_list_materialize() must // be called. list->lv_first = &range_list_item; ! list->lv_start = start; ! list->lv_end = end; ! list->lv_stride = stride; list->lv_len = (end - start) / stride + 1; } } --- 5330,5338 ---- // works with ":for". If used otherwise range_list_materialize() must // be called. list->lv_first = &range_list_item; ! list->lv_u.nonmat.lv_start = start; ! list->lv_u.nonmat.lv_end = end; ! list->lv_u.nonmat.lv_stride = stride; list->lv_len = (end - start) / stride + 1; } } *************** *** 5345,5359 **** { if (list->lv_first == &range_list_item) { ! varnumber_T start = list->lv_start; ! varnumber_T end = list->lv_end; ! int stride = list->lv_stride; varnumber_T i; list->lv_first = NULL; ! list->lv_last = NULL; list->lv_len = 0; ! list->lv_idx_item = NULL; for (i = start; stride > 0 ? i <= end : i >= end; i += stride) if (list_append_number(list, (varnumber_T)i) == FAIL) break; --- 5345,5359 ---- { if (list->lv_first == &range_list_item) { ! varnumber_T start = list->lv_u.nonmat.lv_start; ! varnumber_T end = list->lv_u.nonmat.lv_end; ! int stride = list->lv_u.nonmat.lv_stride; varnumber_T i; list->lv_first = NULL; ! list->lv_u.mat.lv_last = NULL; list->lv_len = 0; ! list->lv_u.mat.lv_idx_item = NULL; for (i = start; stride > 0 ? i <= end : i >= end; i += stride) if (list_append_number(list, (varnumber_T)i) == FAIL) break; *** ../vim-8.2.0172/src/channel.c 2020-01-27 22:09:35.796838619 +0100 --- src/channel.c 2020-01-29 20:54:34.999893595 +0100 *************** *** 4166,4173 **** // Move the item from the list and then change the type to // avoid the value being freed. ! *rettv = list->lv_last->li_tv; ! list->lv_last->li_tv.v_type = VAR_NUMBER; free_tv(listtv); } } --- 4166,4173 ---- // Move the item from the list and then change the type to // avoid the value being freed. ! *rettv = list->lv_u.mat.lv_last->li_tv; ! list->lv_u.mat.lv_last->li_tv.v_type = VAR_NUMBER; free_tv(listtv); } } *** ../vim-8.2.0172/src/if_mzsch.c 2020-01-11 16:05:19.590287629 +0100 --- src/if_mzsch.c 2020-01-29 20:55:15.599694653 +0100 *************** *** 3044,3050 **** MZ_GC_VAR_IN_REG(0, obj); MZ_GC_REG(); ! curr = list->lv_last; obj = vim_to_mzscheme_impl(&curr->li_tv, depth + 1, visited); result = scheme_make_pair(obj, scheme_null); MZ_GC_CHECK(); --- 3044,3050 ---- MZ_GC_VAR_IN_REG(0, obj); MZ_GC_REG(); ! curr = list->lv_u.mat.lv_last; obj = vim_to_mzscheme_impl(&curr->li_tv, depth + 1, visited); result = scheme_make_pair(obj, scheme_null); MZ_GC_CHECK(); *** ../vim-8.2.0172/src/if_py_both.h 2020-01-26 21:42:00.089532706 +0100 --- src/if_py_both.h 2020-01-29 20:56:17.507391670 +0100 *************** *** 2628,2634 **** if (li) lastaddedli = li->li_prev; else ! lastaddedli = l->lv_last; numadded++; } clear_tv(&v); --- 2628,2634 ---- if (li) lastaddedli = li->li_prev; else ! lastaddedli = l->lv_u.mat.lv_last; numadded++; } clear_tv(&v); *** ../vim-8.2.0172/src/version.c 2020-01-28 23:13:39.458166365 +0100 --- src/version.c 2020-01-29 21:03:23.628527227 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 173, /**/ -- hundred-and-one symptoms of being an internet addict: 9. All your daydreaming is preoccupied with getting a faster connection to the net: cable modem...100 Mbit...Fiber...1Gbit /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///