]> granicus.if.org Git - vim/commitdiff
patch 8.2.0170: Coverity warning for ignoring return value v8.2.0170
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 22:04:06 +0000 (23:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 22:04:06 +0000 (23:04 +0100)
Problem:    Coverity warning for ignoring return value.
Solution:   Check the return value and return if failed.

src/version.c
src/vim9compile.c

index 55602669f267e35cc40a5b730cc166f4daa221cb..c8b576d0d1d64c49a4b36a2d704c31e064712eff 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    170,
 /**/
     169,
 /**/
index 983108106a9027faa9ca16b8638e3f9230bd51dd..524bcde78e629f5b4093c03b66569c920b85aeb2 100644 (file)
@@ -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);