diff options
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index eb663a1096..6c208786a3 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -5272,7 +5272,7 @@ exec_instructions(ectx_T *ectx) // Useful when used in unpack assignment. Reset at // ISN_DROP. ectx->ec_where.wt_index = gi->gi_index + 1; - ectx->ec_where.wt_variable = TRUE; + ectx->ec_where.wt_kind = WT_VARIABLE; } break; @@ -5442,20 +5442,20 @@ exec_instructions(ectx_T *ectx) case ISN_CHECKTYPE: { checktype_T *ct = &iptr->isn_arg.type; - int save_wt_variable = ectx->ec_where.wt_variable; int r; + where_T where = WHERE_INIT; tv = STACK_TV_BOT((int)ct->ct_off); SOURCING_LNUM = iptr->isn_lnum; - if (!ectx->ec_where.wt_variable) - ectx->ec_where.wt_index = ct->ct_arg_idx; - ectx->ec_where.wt_variable = ct->ct_is_var; - r = check_typval_type(ct->ct_type, tv, ectx->ec_where); - ectx->ec_where.wt_variable = save_wt_variable; + if (ct->ct_arg_idx > 0) + { + where.wt_index = ct->ct_arg_idx; + where.wt_kind = ct->ct_is_var ? WT_VARIABLE : WT_ARGUMENT; + where.wt_func_name = ectx->ec_where.wt_func_name; + } + r = check_typval_type(ct->ct_type, tv, where); if (r == FAIL) goto on_error; - if (!ectx->ec_where.wt_variable) - ectx->ec_where.wt_index = 0; // number 0 is FALSE, number 1 is TRUE if (tv->v_type == VAR_NUMBER @@ -5736,8 +5736,7 @@ exec_instructions(ectx_T *ectx) case ISN_DROP: --ectx->ec_stack.ga_len; clear_tv(STACK_TV_BOT(0)); - ectx->ec_where.wt_index = 0; - ectx->ec_where.wt_variable = FALSE; + ectx->ec_where = (where_T)WHERE_INIT; break; } continue; @@ -6170,8 +6169,7 @@ call_def_function( emsg_silent_def = emsg_silent; did_emsg_def = 0; - ectx.ec_where.wt_index = 0; - ectx.ec_where.wt_variable = FALSE; + ectx.ec_where = (where_T)WHERE_INIT; /* * Execute the instructions until done. |