0029859: Coding - GCC compiler warning -Warray-bounds in IntPatch_InterferencePolyhed... IR-DEV-INTEG
authorabv <abv@opencascade.com>
Tue, 12 Jun 2018 19:18:34 +0000 (22:18 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 14 Jun 2018 11:03:14 +0000 (14:03 +0300)
Code is corrected to avoid copying uninitialized element of the array

src/IntPatch/IntPatch_InterferencePolyhedron.cxx

index aad11b9..9f920f6 100644 (file)
@@ -901,11 +901,11 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue
        if (nob<0) break;
       }
       if (nob>=0) {
-       while (nob<nbNoInserted) {
+       nbNoInserted--;
+       while (nob < nbNoInserted) {
          piToInsert[nob]=piToInsert[nob+1];
          nob++;
        }
-       nbNoInserted--;
        nob=nbNoInserted-1;
       }
     }