comparison src/vim9type.c @ 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 f1010a0e6226
children ec54b510e5ee
comparison
equal deleted inserted replaced
30585:35b47a7da6dc 30586:4a1b0a12b430
483 *type = *ufunc->uf_func_type; 483 *type = *ufunc->uf_func_type;
484 if (type->tt_argcount >= 0) 484 if (type->tt_argcount >= 0)
485 { 485 {
486 type->tt_argcount -= tv->vval.v_partial->pt_argc; 486 type->tt_argcount -= tv->vval.v_partial->pt_argc;
487 type->tt_min_argcount -= tv->vval.v_partial->pt_argc; 487 type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
488 if (type->tt_argcount <= 0) 488 if (type->tt_argcount > 0
489 type->tt_args = NULL; 489 && func_type_add_arg_types(type,
490 else 490 type->tt_argcount, type_gap) == OK)
491 { 491 for (int i = 0; i < type->tt_argcount; ++i)
492 int i; 492 type->tt_args[i] =
493 493 ufunc->uf_func_type->tt_args[
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[
498 i + tv->vval.v_partial->pt_argc]; 494 i + tv->vval.v_partial->pt_argc];
499 }
500 } 495 }
501 return type; 496 return type;
502 } 497 }
503 return ufunc->uf_func_type; 498 return ufunc->uf_func_type;
504 } 499 }