0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.2751: Coverity warns for using NULL pointer

Problem:    Coverity warns for using NULL pointer.
Solution:   Check for NULL in calling function.
This commit is contained in:
Bram Moolenaar 2021-04-10 21:38:38 +02:00
parent da479c7597
commit fed9e830fc
2 changed files with 6 additions and 2 deletions

View File

@ -973,8 +973,7 @@ lambda_function_body(
garray_T *default_args, garray_T *default_args,
char_u *ret_type) char_u *ret_type)
{ {
int evaluate = evalarg != NULL int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
&& (evalarg->eval_flags & EVAL_EVALUATE);
ufunc_T *ufunc = NULL; ufunc_T *ufunc = NULL;
exarg_T eap; exarg_T eap;
garray_T newlines; garray_T newlines;
@ -1180,6 +1179,9 @@ get_lambda_tv(
// Recognize "{" as the start of a function body. // Recognize "{" as the start of a function body.
if (equal_arrow && **arg == '{') if (equal_arrow && **arg == '{')
{ {
if (evalarg == NULL)
// cannot happen?
goto theend;
if (lambda_function_body(arg, rettv, evalarg, pnewargs, if (lambda_function_body(arg, rettv, evalarg, pnewargs,
types_optional ? &argtypes : NULL, varargs, types_optional ? &argtypes : NULL, varargs,
&default_args, ret_type) == FAIL) &default_args, ret_type) == FAIL)

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2751,
/**/ /**/
2750, 2750,
/**/ /**/