Patch 9.0.0628
Problem: Coverity warns for not checking return value.
Solution: Check the return value and simplify the code.
Files: src/vim9type.c
*** ../vim-9.0.0627/src/vim9type.c 2022-09-29 20:23:32.200338251 +0100
--- src/vim9type.c 2022-09-30 11:56:30.949389299 +0100
***************
*** 485,502 ****
{
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[
i + tv->vval.v_partial->pt_argc];
- }
}
return type;
}
--- 485,497 ----
{
type->tt_argcount -= tv->vval.v_partial->pt_argc;
type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
! 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;
}
*** ../vim-9.0.0627/src/version.c 2022-09-30 11:04:47.169344522 +0100
--- src/version.c 2022-09-30 11:59:27.845151236 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 628,
/**/
--
hundred-and-one symptoms of being an internet addict:
227. You sleep next to your monitor. Or on top of it.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///