0027941: Foundation Classes - NCollection_Vector::Iterator::offsetV() does not match...
[occt.git] / src / NCollection / NCollection_BaseVector.hxx
index c0a93ec..08c6a61 100755 (executable)
@@ -117,6 +117,13 @@ protected:
       const Standard_Integer anIndex = myCurIndex + myICurBlock * myVector->myIncrement + theOffset;
       myICurBlock = anIndex / myVector->myIncrement;
       myCurIndex = anIndex % myVector->myIncrement;
+      if (myICurBlock > myIEndBlock)
+      {
+        // make sure that iterator produced by Offset()
+        // is equal to the end() iterator
+        --myICurBlock;
+        myCurIndex += myVector->myIncrement;
+      }
     }
 
     Standard_Integer differV (const Iterator& theOther) const