0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.0173: build fails with old compiler

Problem:    Build fails with old compiler.
Solution:   Do not use anonymous unions. (John Marriott)
This commit is contained in:
Bram Moolenaar 2020-01-29 21:27:21 +01:00
parent 4549ece47c
commit 0ff6aad393
9 changed files with 88 additions and 84 deletions

View File

@ -4166,8 +4166,8 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
// Move the item from the list and then change the type to // Move the item from the list and then change the type to
// avoid the value being freed. // avoid the value being freed.
*rettv = list->lv_last->li_tv; *rettv = list->lv_u.mat.lv_last->li_tv;
list->lv_last->li_tv.v_type = VAR_NUMBER; list->lv_u.mat.lv_last->li_tv.v_type = VAR_NUMBER;
free_tv(listtv); free_tv(listtv);
} }
} }

View File

@ -4070,7 +4070,7 @@ f_index(typval_T *argvars, typval_T *rettv)
// Start at specified item. Use the cached index that list_find() // Start at specified item. Use the cached index that list_find()
// sets, so that a negative number also works. // sets, so that a negative number also works.
item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error)); item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error));
idx = l->lv_idx; idx = l->lv_u.mat.lv_idx;
if (argvars[3].v_type != VAR_UNKNOWN) if (argvars[3].v_type != VAR_UNKNOWN)
ic = (int)tv_get_number_chk(&argvars[3], &error); ic = (int)tv_get_number_chk(&argvars[3], &error);
if (error) if (error)
@ -4678,7 +4678,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, matchtype_T type)
li = list_find(l, start); li = list_find(l, start);
if (li == NULL) if (li == NULL)
goto theend; goto theend;
idx = l->lv_idx; // use the cached index idx = l->lv_u.mat.lv_idx; // use the cached index
} }
else else
{ {
@ -5330,9 +5330,9 @@ f_range(typval_T *argvars, typval_T *rettv)
// works with ":for". If used otherwise range_list_materialize() must // works with ":for". If used otherwise range_list_materialize() must
// be called. // be called.
list->lv_first = &range_list_item; list->lv_first = &range_list_item;
list->lv_start = start; list->lv_u.nonmat.lv_start = start;
list->lv_end = end; list->lv_u.nonmat.lv_end = end;
list->lv_stride = stride; list->lv_u.nonmat.lv_stride = stride;
list->lv_len = (end - start) / stride + 1; list->lv_len = (end - start) / stride + 1;
} }
} }
@ -5345,15 +5345,15 @@ range_list_materialize(list_T *list)
{ {
if (list->lv_first == &range_list_item) if (list->lv_first == &range_list_item)
{ {
varnumber_T start = list->lv_start; varnumber_T start = list->lv_u.nonmat.lv_start;
varnumber_T end = list->lv_end; varnumber_T end = list->lv_u.nonmat.lv_end;
int stride = list->lv_stride; int stride = list->lv_u.nonmat.lv_stride;
varnumber_T i; varnumber_T i;
list->lv_first = NULL; list->lv_first = NULL;
list->lv_last = NULL; list->lv_u.mat.lv_last = NULL;
list->lv_len = 0; list->lv_len = 0;
list->lv_idx_item = NULL; list->lv_u.mat.lv_idx_item = NULL;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride) for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
if (list_append_number(list, (varnumber_T)i) == FAIL) if (list_append_number(list, (varnumber_T)i) == FAIL)
break; break;

View File

@ -2128,7 +2128,7 @@ set_argv_var(char **argv, int argc)
{ {
if (list_append_string(l, (char_u *)argv[i], -1) == FAIL) if (list_append_string(l, (char_u *)argv[i], -1) == FAIL)
getout(1); getout(1);
l->lv_last->li_tv.v_lock = VAR_FIXED; l->lv_u.mat.lv_last->li_tv.v_lock = VAR_FIXED;
} }
set_vim_var_list(VV_ARGV, l); set_vim_var_list(VV_ARGV, l);
} }

View File

@ -3044,7 +3044,7 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
MZ_GC_VAR_IN_REG(0, obj); MZ_GC_VAR_IN_REG(0, obj);
MZ_GC_REG(); MZ_GC_REG();
curr = list->lv_last; curr = list->lv_u.mat.lv_last;
obj = vim_to_mzscheme_impl(&curr->li_tv, depth + 1, visited); obj = vim_to_mzscheme_impl(&curr->li_tv, depth + 1, visited);
result = scheme_make_pair(obj, scheme_null); result = scheme_make_pair(obj, scheme_null);
MZ_GC_CHECK(); MZ_GC_CHECK();

View File

@ -2628,7 +2628,7 @@ ListAssSlice(ListObject *self, Py_ssize_t first,
if (li) if (li)
lastaddedli = li->li_prev; lastaddedli = li->li_prev;
else else
lastaddedli = l->lv_last; lastaddedli = l->lv_u.mat.lv_last;
numadded++; numadded++;
} }
clear_tv(&v); clear_tv(&v);

View File

@ -126,7 +126,7 @@ list_alloc_with_items(int count)
l->lv_len = count; l->lv_len = count;
l->lv_with_items = count; l->lv_with_items = count;
l->lv_first = li; l->lv_first = li;
l->lv_last = li + count - 1; l->lv_u.mat.lv_last = li + count - 1;
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
if (i == 0) if (i == 0)
@ -406,25 +406,25 @@ list_find(list_T *l, long n)
range_list_materialize(l); range_list_materialize(l);
// When there is a cached index may start search from there. // When there is a cached index may start search from there.
if (l->lv_idx_item != NULL) if (l->lv_u.mat.lv_idx_item != NULL)
{ {
if (n < l->lv_idx / 2) if (n < l->lv_u.mat.lv_idx / 2)
{ {
// closest to the start of the list // closest to the start of the list
item = l->lv_first; item = l->lv_first;
idx = 0; idx = 0;
} }
else if (n > (l->lv_idx + l->lv_len) / 2) else if (n > (l->lv_u.mat.lv_idx + l->lv_len) / 2)
{ {
// closest to the end of the list // closest to the end of the list
item = l->lv_last; item = l->lv_u.mat.lv_last;
idx = l->lv_len - 1; idx = l->lv_len - 1;
} }
else else
{ {
// closest to the cached index // closest to the cached index
item = l->lv_idx_item; item = l->lv_u.mat.lv_idx_item;
idx = l->lv_idx; idx = l->lv_u.mat.lv_idx;
} }
} }
else else
@ -438,7 +438,7 @@ list_find(list_T *l, long n)
else else
{ {
// closest to the end of the list // closest to the end of the list
item = l->lv_last; item = l->lv_u.mat.lv_last;
idx = l->lv_len - 1; idx = l->lv_len - 1;
} }
} }
@ -457,8 +457,8 @@ list_find(list_T *l, long n)
} }
// cache the used index // cache the used index
l->lv_idx = idx; l->lv_u.mat.lv_idx = idx;
l->lv_idx_item = item; l->lv_u.mat.lv_idx_item = item;
return item; return item;
} }
@ -491,7 +491,7 @@ list_find_nr(
return -1L; return -1L;
} }
return l->lv_start + n * l->lv_stride; return l->lv_u.nonmat.lv_start + n * l->lv_u.nonmat.lv_stride;
} }
li = list_find(l, idx); li = list_find(l, idx);
@ -549,18 +549,18 @@ list_idx_of_item(list_T *l, listitem_T *item)
list_append(list_T *l, listitem_T *item) list_append(list_T *l, listitem_T *item)
{ {
range_list_materialize(l); range_list_materialize(l);
if (l->lv_last == NULL) if (l->lv_u.mat.lv_last == NULL)
{ {
// empty list // empty list
l->lv_first = item; l->lv_first = item;
l->lv_last = item; l->lv_u.mat.lv_last = item;
item->li_prev = NULL; item->li_prev = NULL;
} }
else else
{ {
l->lv_last->li_next = item; l->lv_u.mat.lv_last->li_next = item;
item->li_prev = l->lv_last; item->li_prev = l->lv_u.mat.lv_last;
l->lv_last = item; l->lv_u.mat.lv_last = item;
} }
++l->lv_len; ++l->lv_len;
item->li_next = NULL; item->li_next = NULL;
@ -710,12 +710,12 @@ list_insert(list_T *l, listitem_T *ni, listitem_T *item)
if (item->li_prev == NULL) if (item->li_prev == NULL)
{ {
l->lv_first = ni; l->lv_first = ni;
++l->lv_idx; ++l->lv_u.mat.lv_idx;
} }
else else
{ {
item->li_prev->li_next = ni; item->li_prev->li_next = ni;
l->lv_idx_item = NULL; l->lv_u.mat.lv_idx_item = NULL;
} }
item->li_prev = ni; item->li_prev = ni;
++l->lv_len; ++l->lv_len;
@ -846,14 +846,14 @@ vimlist_remove(list_T *l, listitem_T *item, listitem_T *item2)
} }
if (item2->li_next == NULL) if (item2->li_next == NULL)
l->lv_last = item->li_prev; l->lv_u.mat.lv_last = item->li_prev;
else else
item2->li_next->li_prev = item->li_prev; item2->li_next->li_prev = item->li_prev;
if (item->li_prev == NULL) if (item->li_prev == NULL)
l->lv_first = item2->li_next; l->lv_first = item2->li_next;
else else
item->li_prev->li_next = item2->li_next; item->li_prev->li_next = item2->li_next;
l->lv_idx_item = NULL; l->lv_u.mat.lv_idx_item = NULL;
} }
/* /*
@ -1149,7 +1149,7 @@ init_static_list(staticList10_T *sl)
memset(sl, 0, sizeof(staticList10_T)); memset(sl, 0, sizeof(staticList10_T));
l->lv_first = &sl->sl_items[0]; l->lv_first = &sl->sl_items[0];
l->lv_last = &sl->sl_items[9]; l->lv_u.mat.lv_last = &sl->sl_items[9];
l->lv_refcount = DO_NOT_FREE_CNT; l->lv_refcount = DO_NOT_FREE_CNT;
l->lv_lock = VAR_FIXED; l->lv_lock = VAR_FIXED;
sl->sl_list.lv_len = 10; sl->sl_list.lv_len = 10;
@ -1280,7 +1280,7 @@ list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
{ {
l = rettv->vval.v_list; l = rettv->vval.v_list;
l->lv_first = item; l->lv_first = item;
l->lv_last = item2; l->lv_u.mat.lv_last = item2;
item->li_prev = NULL; item->li_prev = NULL;
item2->li_next = NULL; item2->li_next = NULL;
l->lv_len = cnt; l->lv_len = cnt;
@ -1605,7 +1605,8 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
if (!info.item_compare_func_err) if (!info.item_compare_func_err)
{ {
// Clear the List and append the items in sorted order. // Clear the List and append the items in sorted order.
l->lv_first = l->lv_last = l->lv_idx_item = NULL; l->lv_first = l->lv_u.mat.lv_last
= l->lv_u.mat.lv_idx_item = NULL;
l->lv_len = 0; l->lv_len = 0;
for (i = 0; i < len; ++i) for (i = 0; i < len; ++i)
list_append(l, ptrs[i].item); list_append(l, ptrs[i].item);
@ -1645,7 +1646,7 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
if (li->li_next != NULL) if (li->li_next != NULL)
li->li_next->li_prev = ptrs[i].item; li->li_next->li_prev = ptrs[i].item;
else else
l->lv_last = ptrs[i].item; l->lv_u.mat.lv_last = ptrs[i].item;
list_fix_watch(l, li); list_fix_watch(l, li);
listitem_free(l, li); listitem_free(l, li);
l->lv_len--; l->lv_len--;
@ -2259,16 +2260,17 @@ f_reverse(typval_T *argvars, typval_T *rettv)
{ {
if (l->lv_first == &range_list_item) if (l->lv_first == &range_list_item)
{ {
varnumber_T new_start = l->lv_start varnumber_T new_start = l->lv_u.nonmat.lv_start
+ (l->lv_len - 1) * l->lv_stride; + (l->lv_len - 1) * l->lv_u.nonmat.lv_stride;
l->lv_end = new_start - (l->lv_end - l->lv_start); l->lv_u.nonmat.lv_end = new_start
l->lv_start = new_start; - (l->lv_u.nonmat.lv_end - l->lv_u.nonmat.lv_start);
l->lv_stride = -l->lv_stride; 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); rettv_list_set(rettv, l);
return; return;
} }
li = l->lv_last; li = l->lv_u.mat.lv_last;
l->lv_first = l->lv_last = NULL; l->lv_first = l->lv_u.mat.lv_last = NULL;
l->lv_len = 0; l->lv_len = 0;
while (li != NULL) while (li != NULL)
{ {
@ -2277,7 +2279,7 @@ f_reverse(typval_T *argvars, typval_T *rettv)
li = ni; li = ni;
} }
rettv_list_set(rettv, l); rettv_list_set(rettv, l);
l->lv_idx = l->lv_len - l->lv_idx - 1; l->lv_u.mat.lv_idx = l->lv_len - l->lv_u.mat.lv_idx - 1;
} }
} }

View File

@ -1410,13 +1410,13 @@ struct listvar_S
varnumber_T lv_start; varnumber_T lv_start;
varnumber_T lv_end; varnumber_T lv_end;
int lv_stride; int lv_stride;
}; } nonmat;
struct { // used for materialized list struct { // used for materialized list
listitem_T *lv_last; // last item, NULL if none listitem_T *lv_last; // last item, NULL if none
listitem_T *lv_idx_item; // when not NULL item at index "lv_idx" listitem_T *lv_idx_item; // when not NULL item at index "lv_idx"
int lv_idx; // cached index of an item int lv_idx; // cached index of an item
}; } mat;
}; } lv_u;
list_T *lv_copylist; // copied list used by deepcopy() list_T *lv_copylist; // copied list used by deepcopy()
list_T *lv_used_next; // next list in used lists list list_T *lv_used_next; // next list in used lists list
list_T *lv_used_prev; // previous list in used lists list list_T *lv_used_prev; // previous list in used lists list

View File

@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
173,
/**/ /**/
172, 172,
/**/ /**/

View File

@ -88,7 +88,7 @@ struct scope_S {
whilescope_T se_while; whilescope_T se_while;
forscope_T se_for; forscope_T se_for;
tryscope_T se_try; tryscope_T se_try;
}; } se_u;
}; };
/* /*
@ -3506,7 +3506,7 @@ compile_if(char_u *arg, cctx_T *cctx)
return NULL; return NULL;
// "where" is set when ":elseif", "else" or ":endif" is found // "where" is set when ":elseif", "else" or ":endif" is found
scope->se_if.is_if_label = instr->ga_len; scope->se_u.se_if.is_if_label = instr->ga_len;
generate_JUMP(cctx, JUMP_IF_FALSE, 0); generate_JUMP(cctx, JUMP_IF_FALSE, 0);
return p; return p;
@ -3528,12 +3528,12 @@ compile_elseif(char_u *arg, cctx_T *cctx)
cctx->ctx_locals.ga_len = scope->se_local_count; cctx->ctx_locals.ga_len = scope->se_local_count;
// jump from previous block to the end // jump from previous block to the end
if (compile_jump_to_end(&scope->se_if.is_end_label, if (compile_jump_to_end(&scope->se_u.se_if.is_end_label,
JUMP_ALWAYS, cctx) == FAIL) JUMP_ALWAYS, cctx) == FAIL)
return NULL; return NULL;
// previous "if" or "elseif" jumps here // previous "if" or "elseif" jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label;
isn->isn_arg.jump.jump_where = instr->ga_len; isn->isn_arg.jump.jump_where = instr->ga_len;
// compile "expr" // compile "expr"
@ -3541,7 +3541,7 @@ compile_elseif(char_u *arg, cctx_T *cctx)
return NULL; return NULL;
// "where" is set when ":elseif", "else" or ":endif" is found // "where" is set when ":elseif", "else" or ":endif" is found
scope->se_if.is_if_label = instr->ga_len; scope->se_u.se_if.is_if_label = instr->ga_len;
generate_JUMP(cctx, JUMP_IF_FALSE, 0); generate_JUMP(cctx, JUMP_IF_FALSE, 0);
return p; return p;
@ -3563,12 +3563,12 @@ compile_else(char_u *arg, cctx_T *cctx)
cctx->ctx_locals.ga_len = scope->se_local_count; cctx->ctx_locals.ga_len = scope->se_local_count;
// jump from previous block to the end // jump from previous block to the end
if (compile_jump_to_end(&scope->se_if.is_end_label, if (compile_jump_to_end(&scope->se_u.se_if.is_end_label,
JUMP_ALWAYS, cctx) == FAIL) JUMP_ALWAYS, cctx) == FAIL)
return NULL; return NULL;
// previous "if" or "elseif" jumps here // previous "if" or "elseif" jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label;
isn->isn_arg.jump.jump_where = instr->ga_len; isn->isn_arg.jump.jump_where = instr->ga_len;
return p; return p;
@ -3587,12 +3587,12 @@ compile_endif(char_u *arg, cctx_T *cctx)
emsg(_(e_endif_without_if)); emsg(_(e_endif_without_if));
return NULL; return NULL;
} }
ifscope = &scope->se_if; ifscope = &scope->se_u.se_if;
cctx->ctx_scope = scope->se_outer; cctx->ctx_scope = scope->se_outer;
cctx->ctx_locals.ga_len = scope->se_local_count; cctx->ctx_locals.ga_len = scope->se_local_count;
// previous "if" or "elseif" jumps here // previous "if" or "elseif" jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_if.is_if_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label;
isn->isn_arg.jump.jump_where = instr->ga_len; isn->isn_arg.jump.jump_where = instr->ga_len;
// Fill in the "end" label in jumps at the end of the blocks. // Fill in the "end" label in jumps at the end of the blocks.
@ -3688,7 +3688,7 @@ compile_for(char_u *arg, cctx_T *cctx)
} }
// "for_end" is set when ":endfor" is found // "for_end" is set when ":endfor" is found
scope->se_for.fs_top_label = instr->ga_len; scope->se_u.se_for.fs_top_label = instr->ga_len;
generate_FOR(cctx, loop_idx); generate_FOR(cctx, loop_idx);
generate_STORE(cctx, ISN_STORE, var_idx, NULL); generate_STORE(cctx, ISN_STORE, var_idx, NULL);
@ -3712,7 +3712,7 @@ compile_endfor(char_u *arg, cctx_T *cctx)
emsg(_(e_for)); emsg(_(e_for));
return NULL; return NULL;
} }
forscope = &scope->se_for; forscope = &scope->se_u.se_for;
cctx->ctx_scope = scope->se_outer; cctx->ctx_scope = scope->se_outer;
cctx->ctx_locals.ga_len = scope->se_local_count; cctx->ctx_locals.ga_len = scope->se_local_count;
@ -3757,14 +3757,14 @@ compile_while(char_u *arg, cctx_T *cctx)
if (scope == NULL) if (scope == NULL)
return NULL; return NULL;
scope->se_while.ws_top_label = instr->ga_len; scope->se_u.se_while.ws_top_label = instr->ga_len;
// compile "expr" // compile "expr"
if (compile_expr1(&p, cctx) == FAIL) if (compile_expr1(&p, cctx) == FAIL)
return NULL; return NULL;
// "while_end" is set when ":endwhile" is found // "while_end" is set when ":endwhile" is found
if (compile_jump_to_end(&scope->se_while.ws_end_label, if (compile_jump_to_end(&scope->se_u.se_while.ws_end_label,
JUMP_IF_FALSE, cctx) == FAIL) JUMP_IF_FALSE, cctx) == FAIL)
return FAIL; return FAIL;
@ -3788,11 +3788,11 @@ compile_endwhile(char_u *arg, cctx_T *cctx)
cctx->ctx_locals.ga_len = scope->se_local_count; cctx->ctx_locals.ga_len = scope->se_local_count;
// At end of ":for" scope jump back to the FOR instruction. // At end of ":for" scope jump back to the FOR instruction.
generate_JUMP(cctx, JUMP_ALWAYS, scope->se_while.ws_top_label); 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. // Fill in the "end" label in the WHILE statement so it can jump here.
// And in any jumps for ":break" // And in any jumps for ":break"
compile_fill_jump_to_end(&scope->se_while.ws_end_label, cctx); compile_fill_jump_to_end(&scope->se_u.se_while.ws_end_label, cctx);
vim_free(scope); vim_free(scope);
@ -3821,8 +3821,8 @@ compile_continue(char_u *arg, cctx_T *cctx)
// Jump back to the FOR or WHILE instruction. // Jump back to the FOR or WHILE instruction.
generate_JUMP(cctx, JUMP_ALWAYS, generate_JUMP(cctx, JUMP_ALWAYS,
scope->se_type == FOR_SCOPE ? scope->se_for.fs_top_label scope->se_type == FOR_SCOPE ? scope->se_u.se_for.fs_top_label
: scope->se_while.ws_top_label); : scope->se_u.se_while.ws_top_label);
return arg; return arg;
} }
@ -3849,9 +3849,9 @@ compile_break(char_u *arg, cctx_T *cctx)
// Jump to the end of the FOR or WHILE loop. // Jump to the end of the FOR or WHILE loop.
if (scope->se_type == FOR_SCOPE) if (scope->se_type == FOR_SCOPE)
el = &scope->se_for.fs_end_label; el = &scope->se_u.se_for.fs_end_label;
else else
el = &scope->se_while.ws_end_label; el = &scope->se_u.se_while.ws_end_label;
if (compile_jump_to_end(el, JUMP_ALWAYS, cctx) == FAIL) if (compile_jump_to_end(el, JUMP_ALWAYS, cctx) == FAIL)
return FAIL; return FAIL;
@ -3928,7 +3928,7 @@ compile_try(char_u *arg, cctx_T *cctx)
// "catch" is set when the first ":catch" is found. // "catch" is set when the first ":catch" is found.
// "finally" is set when ":finally" or ":endtry" is found // "finally" is set when ":finally" or ":endtry" is found
try_scope->se_try.ts_try_label = instr->ga_len; try_scope->se_u.se_try.ts_try_label = instr->ga_len;
if (generate_instr(cctx, ISN_TRY) == NULL) if (generate_instr(cctx, ISN_TRY) == NULL)
return NULL; return NULL;
@ -3963,33 +3963,33 @@ compile_catch(char_u *arg, cctx_T *cctx UNUSED)
return NULL; return NULL;
} }
if (scope->se_try.ts_caught_all) if (scope->se_u.se_try.ts_caught_all)
{ {
emsg(_("E1033: catch unreachable after catch-all")); emsg(_("E1033: catch unreachable after catch-all"));
return NULL; return NULL;
} }
// Jump from end of previous block to :finally or :endtry // Jump from end of previous block to :finally or :endtry
if (compile_jump_to_end(&scope->se_try.ts_end_label, if (compile_jump_to_end(&scope->se_u.se_try.ts_end_label,
JUMP_ALWAYS, cctx) == FAIL) JUMP_ALWAYS, cctx) == FAIL)
return NULL; return NULL;
// End :try or :catch scope: set value in ISN_TRY instruction // End :try or :catch scope: set value in ISN_TRY instruction
isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label;
if (isn->isn_arg.try.try_catch == 0) if (isn->isn_arg.try.try_catch == 0)
isn->isn_arg.try.try_catch = instr->ga_len; isn->isn_arg.try.try_catch = instr->ga_len;
if (scope->se_try.ts_catch_label != 0) if (scope->se_u.se_try.ts_catch_label != 0)
{ {
// Previous catch without match jumps here // Previous catch without match jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_catch_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label;
isn->isn_arg.jump.jump_where = instr->ga_len; isn->isn_arg.jump.jump_where = instr->ga_len;
} }
p = skipwhite(arg); p = skipwhite(arg);
if (ends_excmd(*p)) if (ends_excmd(*p))
{ {
scope->se_try.ts_caught_all = TRUE; scope->se_u.se_try.ts_caught_all = TRUE;
scope->se_try.ts_catch_label = 0; scope->se_u.se_try.ts_catch_label = 0;
} }
else else
{ {
@ -4003,7 +4003,7 @@ compile_catch(char_u *arg, cctx_T *cctx UNUSED)
if (generate_COMPARE(cctx, EXPR_MATCH, FALSE) == FAIL) if (generate_COMPARE(cctx, EXPR_MATCH, FALSE) == FAIL)
return NULL; return NULL;
scope->se_try.ts_catch_label = instr->ga_len; scope->se_u.se_try.ts_catch_label = instr->ga_len;
if (generate_JUMP(cctx, JUMP_IF_FALSE, 0) == FAIL) if (generate_JUMP(cctx, JUMP_IF_FALSE, 0) == FAIL)
return NULL; return NULL;
} }
@ -4036,7 +4036,7 @@ compile_finally(char_u *arg, cctx_T *cctx)
} }
// End :catch or :finally scope: set value in ISN_TRY instruction // End :catch or :finally scope: set value in ISN_TRY instruction
isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label;
if (isn->isn_arg.try.try_finally != 0) if (isn->isn_arg.try.try_finally != 0)
{ {
emsg(_(e_finally_dup)); emsg(_(e_finally_dup));
@ -4044,12 +4044,12 @@ compile_finally(char_u *arg, cctx_T *cctx)
} }
// Fill in the "end" label in jumps at the end of the blocks. // 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); compile_fill_jump_to_end(&scope->se_u.se_try.ts_end_label, cctx);
if (scope->se_try.ts_catch_label != 0) if (scope->se_u.se_try.ts_catch_label != 0)
{ {
// Previous catch without match jumps here // Previous catch without match jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_catch_label; isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label;
isn->isn_arg.jump.jump_where = instr->ga_len; isn->isn_arg.jump.jump_where = instr->ga_len;
} }
@ -4085,7 +4085,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
return NULL; return NULL;
} }
isn = ((isn_T *)instr->ga_data) + scope->se_try.ts_try_label; 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) if (isn->isn_arg.try.try_catch == 0 && isn->isn_arg.try.try_finally == 0)
{ {
emsg(_("E1032: missing :catch or :finally")); emsg(_("E1032: missing :catch or :finally"));
@ -4094,7 +4094,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
// Fill in the "end" label in jumps at the end of the blocks, if not done // Fill in the "end" label in jumps at the end of the blocks, if not done
// by ":finally". // by ":finally".
compile_fill_jump_to_end(&scope->se_try.ts_end_label, cctx); 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 // End :catch or :finally scope: set value in ISN_TRY instruction
if (isn->isn_arg.try.try_finally == 0) if (isn->isn_arg.try.try_finally == 0)