summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-28 23:04:06 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-28 23:04:06 +0100
commita6d536829a2c3151f3d0faa0ecdc7b8230fb11ec (patch)
treea8b803a7301406d8d8ab8a366c830fd52512e892
parent8cbd6dfc0c9d84c5be8414dfdea3b28b72dfddb6 (diff)
downloadvim-git-a6d536829a2c3151f3d0faa0ecdc7b8230fb11ec.tar.gz
patch 8.2.0170: Coverity warning for ignoring return valuev8.2.0170
Problem: Coverity warning for ignoring return value. Solution: Check the return value and return if failed.
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/version.c b/src/version.c
index 55602669f..c8b576d0d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 170,
+/**/
169,
/**/
168,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 983108106..524bcde78 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2917,7 +2917,8 @@ compile_expr1(char_u **arg, cctx_T *cctx)
// evaluate the second expression; any type is accepted
*arg = skipwhite(p + 1);
- compile_expr1(arg, cctx);
+ if (compile_expr1(arg, cctx) == FAIL)
+ return FAIL;
// remember the type and drop it
--stack->ga_len;
@@ -2942,7 +2943,8 @@ compile_expr1(char_u **arg, cctx_T *cctx)
// evaluate the third expression
*arg = skipwhite(p + 1);
- compile_expr1(arg, cctx);
+ if (compile_expr1(arg, cctx) == FAIL)
+ return FAIL;
// If the types differ, the result has a more generic type.
type2 = ((type_T **)stack->ga_data)[stack->ga_len - 1];
@@ -3265,6 +3267,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
if (*op != '=')
{
if (option)
+ // TODO: check the option exists
generate_LOAD(cctx, ISN_LOADOPT, 0, name + 1, type);
else if (global)
generate_LOAD(cctx, ISN_LOADG, 0, name + 2, type);