diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-16 14:51:30 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-16 14:51:30 +0000 |
commit | 8f9956994d5c75ed88d6b2881b6ac0bb62a0d6af (patch) | |
tree | bc9978eb07e41cbaf26b9a753df5cbf241926841 /src | |
parent | fd31be29b8220ee1cb0b3460c82f2634ae3cc370 (diff) | |
download | vim-git-8f9956994d5c75ed88d6b2881b6ac0bb62a0d6af.tar.gz |
patch 8.2.4110: Coverity warns for using NULL pointerv8.2.4110
Problem: Coverity warns for using NULL pointer.
Solution: Check "evalarg" is not NULL. Skip errors when "verbose" is false.
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c index 5588abd02..935f19aa7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3973,8 +3973,8 @@ eval_method( int len2; char_u *fname; int idx; - imported_T *import = find_imported(name, len, - TRUE, evalarg->eval_cctx); + imported_T *import = find_imported(name, len, TRUE, + evalarg == NULL ? NULL : evalarg->eval_cctx); type_T *type; // value->import.func() @@ -3986,10 +3986,11 @@ eval_method( len2 = get_name_len(arg, &alias, evaluate, TRUE); if (len2 <= 0) { - emsg(_(e_missing_name_after_dot)); + if (verbose) + emsg(_(e_missing_name_after_dot)); ret = FAIL; } - else + else if (evaluate) { int cc = fname[len2]; ufunc_T *ufunc; @@ -4014,7 +4015,8 @@ eval_method( else { // TODO: how about a partial? - semsg(_(e_not_callable_type_str), fname); + if (verbose) + semsg(_(e_not_callable_type_str), fname); ret = FAIL; } } diff --git a/src/version.c b/src/version.c index bffed683c..b658ec7ae 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4110, +/**/ 4109, /**/ 4108, |