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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220930110243.EA9D91C09A3%40moolenaar.net.

Raspunde prin e-mail lui