commit 2e8cec5f2bf2dd1209052e870d9713a932dc7bfa
parent f4d3e279e861dc37dd047c81a0807767a74d251b
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun, 16 Apr 2023 09:07:03 +0800
vim-patch:8.2.2978: warning for uninitialized variable
Problem: Warning for uninitialized variable.
Solution: Set return value to FAIL.
https://github.com/vim/vim/commit/744aecf8777e86fac6d30f072e90e2de353b8ea1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
@@ -3261,6 +3261,7 @@ static int call_func_rettv(char **const arg, evalarg_T *const evalarg, typval_T
typval_T functv;
const char *funcname;
bool is_lua = false;
+ int ret;
// need to copy the funcref so that we can clear rettv
if (evaluate) {
@@ -3276,6 +3277,7 @@ static int call_func_rettv(char **const arg, evalarg_T *const evalarg, typval_T
funcname = functv.vval.v_string;
if (funcname == NULL || *funcname == NUL) {
emsg(_(e_empty_function_name));
+ ret = FAIL;
goto theend;
}
}
@@ -3290,8 +3292,8 @@ static int call_func_rettv(char **const arg, evalarg_T *const evalarg, typval_T
funcexe.fe_partial = pt;
funcexe.fe_selfdict = selfdict;
funcexe.fe_basetv = basetv;
- const int ret = get_func_tv(funcname, is_lua ? (int)(*arg - funcname) : -1, rettv,
- arg, evalarg, &funcexe);
+ ret = get_func_tv(funcname, is_lua ? (int)(*arg - funcname) : -1, rettv,
+ arg, evalarg, &funcexe);
theend:
// Clear the funcref afterwards, so that deleting it while