]> OCCT Git - occt.git/commitdiff
0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain CR32949
authorakaftasev <akaftasev@opencascade.com>
Mon, 18 Sep 2023 15:49:06 +0000 (16:49 +0100)
committerakaftasev <akaftasev@opencascade.com>
Mon, 18 Sep 2023 15:56:05 +0000 (16:56 +0100)
Problem occurs when InternalEdges is empty but the vertices from VV is not same.
Added condition to stop the loop when InternalEdges is empty.

src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx

index e17fefa111c5635af6dc26258a427da61e56598d..d02ef6482477f90ad8f46fa995fbfd7980fdc626 100644 (file)
@@ -3708,8 +3708,11 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
               TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
               if (anEdge.IsSame(EndEdges[ii]))
                 continue;
-              found = Standard_True;
-              InternalEdges.RemoveKey(anEdge);
+              found = InternalEdges.RemoveKey(anEdge);
+              if (!found)
+              {
+                break;
+              }
               BB.Add(anInternalWire, anEdge);
               TopoDS_Vertex V1, V2;
               TopExp::Vertices(anEdge, V1, V2);