From 8bd52c7323b662d02757d47c7d6a14f2b7a45fd2 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 26 May 2015 18:16:35 +0300 Subject: [PATCH] Avoid crashing in solver --- src/SketchSolver/SketchSolver_Storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) -- 2.39.2