From a4bed17d0d33904eb9cced9a6d3f99388648b408 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Sat, 14 Feb 2015 18:00:28 +0100 Subject: coverity/13746: Negative array index write: FP. Problem : Negative array index write @ 1042. Diagnostic : False positive. Rationale : Suggested error path cannot occur: idx should be >= 0, as previous check ensures there's a matching while/for. Resolution : Assert idx >= 0. --- src/nvim/ex_eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/ex_eval.c') diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index b0c4e14f46..cc474d22ff 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -1028,7 +1028,8 @@ void ex_continue(exarg_T *eap) * next). Therefor, inactivate all conditionals except the ":while" * itself (if reached). */ idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, FALSE); - if (idx >= 0 && (cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR))) { + assert(idx >= 0); + if (cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR)) { rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel); /* -- cgit