diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-23 19:30:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-23 19:30:19 +0200 |
commit | 1b862c466ba4242857eec581f67982d265005ef4 (patch) | |
tree | 4b916da1ab0dc43d8c6c1cb68f11c606d7e68996 | |
parent | c9e7e344ed390d2a22afb88001b6aa80832d2541 (diff) |
patch 8.2.3205: Coverity reports a null pointer dereferencev8.2.3205
Problem: Coverity reports a null pointer dereference.
Solution: Change the logic to avoid Coverity gets confused.
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/version.c b/src/version.c index bd36437451..95c99718be 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3205, +/**/ 3204, /**/ 3203, diff --git a/src/vim9compile.c b/src/vim9compile.c index 23994342c7..fada1346b7 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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; |