From: azv Date: Tue, 26 May 2015 15:16:35 +0000 (+0300) Subject: Avoid crashing in solver X-Git-Tag: V_1.2.0~67 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8bd52c7323b662d02757d47c7d6a14f2b7a45fd2;p=modules%2Fshaper.git Avoid crashing in solver --- diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index 63b22bf4c..0e108b02d 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -554,7 +554,7 @@ int SketchSolver_Storage::deleteTemporaryConstraint() std::set::iterator aCIt = myTemporaryConstraints.begin(); for (; aCIt != myTemporaryConstraints.end(); aCIt++) { int aPos = Search(*aCIt, myConstraints); - if (myConstraints[aPos].type != SLVS_C_WHERE_DRAGGED) + if (aPos >= (int)myConstraints.size() || myConstraints[aPos].type != SLVS_C_WHERE_DRAGGED) break; std::vector::iterator anIt = myConstraints.begin(); for (; anIt != myConstraints.end(); anIt++)