Mercurial > vim
changeset 25336:92e7a55ab0ff v8.2.3205
patch 8.2.3205: Coverity reports a null pointer dereference
Commit: https://github.com/vim/vim/commit/1b862c466ba4242857eec581f67982d265005ef4
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 23 19:30:19 2021 +0200
patch 8.2.3205: Coverity reports a null pointer dereference
Problem: Coverity reports a null pointer dereference.
Solution: Change the logic to avoid Coverity gets confused.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 23 Jul 2021 19:45:05 +0200 |
parents | cc3d1966a224 |
children | 0e5cb14de298 |
files | src/version.c src/vim9compile.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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,
--- 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;