1
0
forked from aniani/vim

patch 8.1.1800: function call functions have too many arguments

Problem:    Function call functions have too many arguments.
Solution:   Pass values in a funcexe_T struct.
This commit is contained in:
Bram Moolenaar
2019-08-03 18:17:11 +02:00
parent 749fa0af85
commit c6538bcc1c
12 changed files with 134 additions and 112 deletions

View File

@@ -1284,9 +1284,9 @@ item_compare2(const void *s1, const void *s2)
int res;
typval_T rettv;
typval_T argv[3];
int dummy;
char_u *func_name;
partial_T *partial = sortinfo->item_compare_partial;
funcexe_T funcexe;
/* shortcut after failure in previous call; compare all items equal */
if (sortinfo->item_compare_func_err)
@@ -1306,8 +1306,11 @@ item_compare2(const void *s1, const void *s2)
copy_tv(&si2->item->li_tv, &argv[1]);
rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */
res = call_func(func_name, -1, &rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE,
partial, sortinfo->item_compare_selfdict);
vim_memset(&funcexe, 0, sizeof(funcexe));
funcexe.evaluate = TRUE;
funcexe.partial = partial;
funcexe.selfdict = sortinfo->item_compare_selfdict;
res = call_func(func_name, -1, &rettv, 2, argv, &funcexe);
clear_tv(&argv[0]);
clear_tv(&argv[1]);