From: eap Date: Tue, 10 Mar 2020 14:11:19 +0000 (+0300) Subject: Fix SIGSEGV on imps_09/K0 X-Git-Tag: V9_5_0a2~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=54db132ba15eba64f6ea4a6f2b5644313e56ff1c;p=modules%2Fsmesh.git Fix SIGSEGV on imps_09/K0 Not sure about "continue;" --- diff --git a/src/SMESHUtils/SMESH_Slot.cxx b/src/SMESHUtils/SMESH_Slot.cxx index 00521c0b5..00c7e6ed2 100644 --- a/src/SMESHUtils/SMESH_Slot.cxx +++ b/src/SMESHUtils/SMESH_Slot.cxx @@ -836,20 +836,22 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt, // 2) double minCutDist = theWidth; gp_XYZ projection, closestProj; - int iCut; - for ( size_t iC = 0; iC < closeSeg[iP]->myCuts.size(); ++iC ) + int iCut = -1; + for ( size_t iC2 = 0; iC2 < closeSeg[iP]->myCuts.size(); ++iC2 ) { - double cutDist = closeSeg[iP]->myCuts[iC].SquareDistance( intPnt[iP].myNode, + double cutDist = closeSeg[iP]->myCuts[iC2].SquareDistance( intPnt[iP].myNode, projection ); if ( cutDist < minCutDist ) { closestProj = projection; minCutDist = cutDist; - iCut = iC; + iCut = iC2; + if ( minCutDist < tol * tol ) + break; } - if ( minCutDist < tol * tol ) - break; } + if ( iCut < 0 ) + continue; // ??? double d1 = SMESH_MeshAlgos::GetDistance( neighborSeg->myEdge, closeSeg[iP]->myCuts[iCut][0].myNode ); double d2 = SMESH_MeshAlgos::GetDistance( neighborSeg->myEdge,