summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-02-22 12:35:17 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-22 12:35:17 +0000
commit666cb9c5303753fef7039e9a9e5fbe9a44299607 (patch)
tree13b8970164006b80b598d1f46675995bea9e82c1
parent38f1ab31fa31196360dc4a31aeb388889b8bd6b8 (diff)
downloadvim-git-666cb9c5303753fef7039e9a9e5fbe9a44299607.tar.gz
patch 9.0.1340: Coverity warns for using NULL pointerv9.0.1340
Problem: Coverity warns for using NULL pointer. Solution: Check that lhs_type is not NULL.
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/version.c b/src/version.c
index 12e5fa107..c541e6f7f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1340,
+/**/
1339,
/**/
1338,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index d45dd63a1..64526aa9d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -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))