1
0
forked from aniani/vim

patch 9.0.1340: Coverity warns for using NULL pointer

Problem:    Coverity warns for using NULL pointer.
Solution:   Check that lhs_type is not NULL.
This commit is contained in:
Bram Moolenaar
2023-02-22 12:35:17 +00:00
parent 38f1ab31fa
commit 666cb9c530
2 changed files with 5 additions and 2 deletions

View File

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

View File

@@ -1848,8 +1848,9 @@ compile_lhs(
lhs->lhs_type = &t_any;
}
int use_class = lhs->lhs_type->tt_type == VAR_CLASS
|| lhs->lhs_type->tt_type == VAR_OBJECT;
int use_class = lhs->lhs_type != NULL
&& (lhs->lhs_type->tt_type == VAR_CLASS
|| lhs->lhs_type->tt_type == VAR_OBJECT);
if (lhs->lhs_type == NULL
|| (use_class ? lhs->lhs_type->tt_class == NULL
: lhs->lhs_type->tt_member == NULL))