• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision4a1b0a12b4301a79cdb2ce7c1aeff27cfd63d6b7 (tree)
Time2022-09-30 20:15:03
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

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.

Change Summary

Incremental Difference

diff -r 35b47a7da6dc -r 4a1b0a12b430 src/version.c
--- a/src/version.c Fri Sep 30 12:15:05 2022 +0200
+++ b/src/version.c Fri Sep 30 13:15:03 2022 +0200
@@ -700,6 +700,8 @@
700700 static int included_patches[] =
701701 { /* Add new patch number below this line */
702702 /**/
703+ 628,
704+/**/
703705 627,
704706 /**/
705707 626,
diff -r 35b47a7da6dc -r 4a1b0a12b430 src/vim9type.c
--- a/src/vim9type.c Fri Sep 30 12:15:05 2022 +0200
+++ b/src/vim9type.c Fri Sep 30 13:15:03 2022 +0200
@@ -485,18 +485,13 @@
485485 {
486486 type->tt_argcount -= tv->vval.v_partial->pt_argc;
487487 type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
488- if (type->tt_argcount <= 0)
489- type->tt_args = NULL;
490- else
491- {
492- int i;
493-
494- func_type_add_arg_types(type, type->tt_argcount,
495- type_gap);
496- for (i = 0; i < type->tt_argcount; ++i)
497- type->tt_args[i] = ufunc->uf_func_type->tt_args[
488+ if (type->tt_argcount > 0
489+ && func_type_add_arg_types(type,
490+ type->tt_argcount, type_gap) == OK)
491+ for (int i = 0; i < type->tt_argcount; ++i)
492+ type->tt_args[i] =
493+ ufunc->uf_func_type->tt_args[
498494 i + tv->vval.v_partial->pt_argc];
499- }
500495 }
501496 return type;
502497 }
Show on old repository browser