aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-16 09:07:03 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-16 10:15:15 +0800
commit2e8cec5f2bf2dd1209052e870d9713a932dc7bfa (patch)
tree70788d34ad5bd9446ea9c3d588fb24ade1f1a1a2
parentf4d3e279e861dc37dd047c81a0807767a74d251b (diff)
downloadrneovim-2e8cec5f2bf2dd1209052e870d9713a932dc7bfa.tar.gz
rneovim-2e8cec5f2bf2dd1209052e870d9713a932dc7bfa.tar.bz2
rneovim-2e8cec5f2bf2dd1209052e870d9713a932dc7bfa.zip
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>
-rw-r--r--src/nvim/eval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index a5c81666c1..1d9061186a 100644
--- 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