changeset 30586:4a1b0a12b430 v9.0.0628

patch 9.0.0628: Coverity warns for not checking return value Commit: https://github.com/vim/vim/commit/d0121c63cfb0922a7048ece3efe994df6f444bed Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 30 12:00:06 2022 +0100 patch 9.0.0628: Coverity warns for not checking return value Problem: Coverity warns for not checking return value. Solution: Check the return value and simplify the code.
author Bram Moolenaar <Bram@vim.org>
date Fri, 30 Sep 2022 13:15:03 +0200
parents 35b47a7da6dc
children 8b4040d04c32
files src/version.c src/vim9type.c
diffstat 2 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    628,
+/**/
     627,
 /**/
     626,
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -485,18 +485,13 @@ typval2type_int(typval_T *tv, int copyID
 		    {
 			type->tt_argcount -= tv->vval.v_partial->pt_argc;
 			type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
-			if (type->tt_argcount <= 0)
-			    type->tt_args = NULL;
-			else
-			{
-			    int i;
-
-			    func_type_add_arg_types(type, type->tt_argcount,
-								     type_gap);
-			    for (i = 0; i < type->tt_argcount; ++i)
-				type->tt_args[i] = ufunc->uf_func_type->tt_args[
+			if (type->tt_argcount > 0
+				&& func_type_add_arg_types(type,
+					    type->tt_argcount, type_gap) == OK)
+			    for (int i = 0; i < type->tt_argcount; ++i)
+				type->tt_args[i] =
+					ufunc->uf_func_type->tt_args[
 					      i + tv->vval.v_partial->pt_argc];
-			}
 		    }
 		    return type;
 		}