dead code in call_internal_method() in evalfunc.c:2723?

9 views
Skip to first unread message

Dominique Pellé

unread,
Jan 1, 2022, 12:42:10 PM1/1/22
to vim_dev
Hi

I see a few lines of code not covered with tests in
call_internal_method() at evalfunc.c:2723. This "if"
block is never entered:

2721 if (global_functions[fi].f_argtype == FEARG_LAST)
2722 {
2723 // base value goes last
2724 for (i = 0; i < argcount; ++i)
2725 argv[i] = argvars[i];
2726 argv[argcount] = *basetv;
2727 }

It seems to be dead code since I don't see where we
assign the value FEARG_LAST:

$ cd vim
$ grep -rn FEARG_LAST .
./evalfunc.c:1205:#define FEARG_LAST 9 // base is the last argument
./evalfunc.c:2721: if (global_functions[fi].f_argtype == FEARG_LAST)

Or am I missing something here?

Regards
Dominique

Bram Moolenaar

unread,
Jan 1, 2022, 2:42:54 PM1/1/22
to vim...@googlegroups.com, Dominique Pellé
Looks like it was planned to be used, but ended up being unused.
I'll remove it.

--
hundred-and-one symptoms of being an internet addict:
180. You maintain more than six e-mail addresses.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages