aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-02-14 18:00:28 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2015-02-20 17:34:07 +0100
commita4bed17d0d33904eb9cced9a6d3f99388648b408 (patch)
tree5980e19bc52ecfacbed7000a3421140c0541f903
parent24fa25a57f9fd2062554f4e2283c367d71ac4050 (diff)
downloadrneovim-a4bed17d0d33904eb9cced9a6d3f99388648b408.tar.gz
rneovim-a4bed17d0d33904eb9cced9a6d3f99388648b408.tar.bz2
rneovim-a4bed17d0d33904eb9cced9a6d3f99388648b408.zip
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.
-rw-r--r--src/nvim/ex_eval.c3
1 files changed, 2 insertions, 1 deletions
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);
/*