0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2387: runtime type check does not mention argument index

Problem:    Runtime type check does not mention argument index.
Solution:   Add ct_arg_idx. (closes #7720)
This commit is contained in:
Bram Moolenaar
2021-01-21 20:21:29 +01:00
parent f904133e1a
commit e32e516dfa
7 changed files with 41 additions and 12 deletions

View File

@@ -3242,7 +3242,8 @@ call_def_function(
tv = STACK_TV_BOT(ct->ct_off);
SOURCING_LNUM = iptr->isn_lnum;
if (check_typval_type(ct->ct_type, tv, 0) == FAIL)
if (check_typval_type(ct->ct_type, tv, ct->ct_arg_idx)
== FAIL)
goto on_error;
// number 0 is FALSE, number 1 is TRUE
@@ -4235,11 +4236,18 @@ ex_disassemble(exarg_T *eap)
case ISN_CHECKNR: smsg("%4d CHECKNR", current); break;
case ISN_CHECKTYPE:
{
checktype_T *ct = &iptr->isn_arg.type;
char *tofree;
smsg("%4d CHECKTYPE %s stack[%d]", current,
type_name(iptr->isn_arg.type.ct_type, &tofree),
iptr->isn_arg.type.ct_off);
if (ct->ct_arg_idx == 0)
smsg("%4d CHECKTYPE %s stack[%d]", current,
type_name(ct->ct_type, &tofree),
(int)ct->ct_off);
else
smsg("%4d CHECKTYPE %s stack[%d] arg %d", current,
type_name(ct->ct_type, &tofree),
(int)ct->ct_off,
(int)ct->ct_arg_idx);
vim_free(tofree);
break;
}