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.
This commit is contained in:
Eliseo Martínez 2015-02-14 18:00:28 +01:00
parent 24fa25a57f
commit a4bed17d0d

View File

@ -1028,7 +1028,8 @@ void ex_continue(exarg_T *eap)
* next). Therefor, inactivate all conditionals except the ":while" * next). Therefor, inactivate all conditionals except the ":while"
* itself (if reached). */ * itself (if reached). */
idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, FALSE); 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); rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel);
/* /*