]> OCCT Git - occt.git/commitdiff
0024909: Modeling Algorithms - SIGSEGV in buildsweep
authorakondrat <alexey.kondratyev@opencascade.com>
Thu, 23 Jun 2022 07:28:39 +0000 (10:28 +0300)
committerakondrat <alexey.kondratyev@opencascade.com>
Tue, 9 Aug 2022 11:39:38 +0000 (14:39 +0300)
Update Extrema_ExtCC::PrepareParallelResult and Extrema_ExtCC::PrepareResults

src/Extrema/Extrema_ExtCC.cxx
tests/bugs/modalg_7/bug24909_4 [new file with mode: 0644]

index def27cbe5e4f0ae6e5db462ca66b03d86b6150a8..0466dc2ec17c41596d5a04b8421d7989be2e678c 100644 (file)
@@ -411,7 +411,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
   if (((aType1 != GeomAbs_Line) && (aType1 != GeomAbs_Circle)) ||
       ((aType2 != GeomAbs_Line) && (aType2 != GeomAbs_Circle)))
   {
-    mySqDist.Append(theSqDist);
+    //mySqDist.Append(theSqDist);
     myDone = Standard_True;
     myIsParallel = Standard_True;
     return;
@@ -432,11 +432,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
                                   !isReversed ? theUt21 : theUt11,
                                   !isReversed ? theUt22 : theUt12);
 
-    if (ExtPLin.IsDone())
-    {
-      mySqDist.Append(theSqDist);
-    }
-    else
+    if (!ExtPLin.IsDone())
     {
       myIsParallel = Standard_False;
     }
@@ -837,7 +833,9 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ExtElC&  AlgExt,
     if (myIsParallel) {
       PrepareParallelResult(Ut11, Ut12, Ut21, Ut22, AlgExt.SquareDistance());
     }
-    else {
+
+    if(mypoints.IsEmpty())
+    {
       NbExt = AlgExt.NbExt();
       for (i = 1; i <= NbExt; i++) {
        // Verification de la validite des parametres
@@ -911,7 +909,7 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ECC&   AlgExt,
     {
       PrepareParallelResult(Ut11, Ut12, Ut21, Ut22, AlgExt.SquareDistance());
     }
-    else
+    if(mypoints.IsEmpty())
     {
       NbExt = AlgExt.NbExt();
       for (i = 1; i <= NbExt; i++)
diff --git a/tests/bugs/modalg_7/bug24909_4 b/tests/bugs/modalg_7/bug24909_4
new file mode 100644 (file)
index 0000000..d2fc6cc
--- /dev/null
@@ -0,0 +1,15 @@
+puts "========"
+puts "0024909: Modeling Algorithms - SIGSEGV in buildsweep"
+puts "========"
+puts ""
+
+pload ALL
+circle c1 0 0 0 40
+mkedge e1 c1
+wire w1 e1
+line l1 0 0 0 0 0 20
+mkedge e2 l1 0 10
+wire w2 e2
+mksweep w1
+addsweep w2
+buildsweep sw1