]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Intersection: fixed seg fault on Ubuntu 20 V9_6_asterxx_0
authorAnida KHIZAR <anida.khizar@cea.fr>
Tue, 17 Nov 2020 11:26:44 +0000 (12:26 +0100)
committerabn <adrien.bruneton@cea.fr>
Thu, 19 Nov 2020 08:57:30 +0000 (09:57 +0100)
src/MEDCoupling/MEDCouplingUMesh_intersection.cxx

index b480bec30b67740d31480fafa6b1662deac5ea0b..7b4eecba9de7677e89885214e4882ccbb119cf26 100644 (file)
@@ -1859,17 +1859,18 @@ void MEDCouplingUMesh::Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D,
 
       std::set<mcIdType> s1(realIdsInDesc2D->begin()+dd2->begin()[*cellId1], realIdsInDesc2D->begin()+dd2->begin()[*cellId1+1]);
       std::set<mcIdType> 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<mcIdType> 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<mcIdType> 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