]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3205: Coverity reports a null pointer dereference v8.2.3205
authorBram Moolenaar <Bram@vim.org>
Fri, 23 Jul 2021 17:30:19 +0000 (19:30 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Jul 2021 17:30:19 +0000 (19:30 +0200)
Problem:    Coverity reports a null pointer dereference.
Solution:   Change the logic to avoid Coverity gets confused.

src/version.c
src/vim9compile.c

index bd364374517ce4d39094ca90032e7a9aa7a87de8..95c99718be2085dd3f0f9659cc9e5c91beb2b5bc 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3205,
 /**/
     3204,
 /**/
index 23994342c775b6b7e8f136498744bc7211c239bf..fada1346b78f708243b4e8a82f5166b62d903ce3 100644 (file)
@@ -5175,14 +5175,14 @@ compile_and_or(
            cctx->ctx_lnum = start_ctx_lnum;
 
            status = check_ppconst_bool(ppconst);
-           if (status == OK)
+           if (status != FAIL)
            {
                // TODO: use ppconst if the value is a constant
                generate_ppconst(cctx, ppconst);
 
                // Every part must evaluate to a bool.
-               status = (bool_on_stack(cctx));
-               if (status == OK)
+               status = bool_on_stack(cctx);
+               if (status != FAIL)
                    status = ga_grow(&end_ga, 1);
            }
            cctx->ctx_lnum = save_lnum;