From: Anida KHIZAR Date: Tue, 17 Nov 2020 11:26:44 +0000 (+0100) Subject: Intersection: fixed seg fault on Ubuntu 20 X-Git-Tag: V9_6_asterxx_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=55affa263c4a05c5acc63811653d4f1059a3a8eb;p=tools%2Fmedcoupling.git Intersection: fixed seg fault on Ubuntu 20 --- diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index b480bec30..7b4eecba9 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -1859,17 +1859,18 @@ void MEDCouplingUMesh::Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, std::set s1(realIdsInDesc2D->begin()+dd2->begin()[*cellId1], realIdsInDesc2D->begin()+dd2->begin()[*cellId1+1]); std::set s2(realIdsInDesc2D->begin()+dd2->begin()[*cellId2], realIdsInDesc2D->begin()+dd2->begin()[*cellId2+1]); - mcIdType commonEdgeId; - std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(), &commonEdgeId); + + std::vector commonEdgeId; + std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(), std::back_inserter(commonEdgeId)); // c- find correct orientation for commonEdgeId const mcIdType* firstNodeInColinearEdgeRet1 = cRet1 + ciRet1[*it]+1; const mcIdType* secondNodeInColinearEdgeRet1 = cRet1 + ciRet1[*it]+2; - std::vector v; v.push_back(commonEdgeId); - if(IsColinearOfACellOf(intersectEdge1, v, *firstNodeInColinearEdgeRet1,*secondNodeInColinearEdgeRet1,commonEdgeId)) + mcIdType commonEdgeIdCorrectlyOriented; + if(IsColinearOfACellOf(intersectEdge1, commonEdgeId, *firstNodeInColinearEdgeRet1,*secondNodeInColinearEdgeRet1, commonEdgeIdCorrectlyOriented)) { idsInRet1Colinear->pushBackSilent(*it); - idsInDescMesh2DForIdsInRetColinear->pushBackSilent(commonEdgeId); + idsInDescMesh2DForIdsInRetColinear->pushBackSilent(commonEdgeIdCorrectlyOriented); } } // ### End colinearity fix