Salome HOME
Minor bug fix seen by '-fsanitize'
authorabn <adrien.bruneton@cea.fr>
Thu, 11 Apr 2024 14:14:34 +0000 (16:14 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 11 Apr 2024 14:14:34 +0000 (16:14 +0200)
src/INTERP_KERNEL/TransformedTriangleIntersect.cxx

index 9fc3a16744bcd2ce55e4f1f463b5ebb84ff8cb7c..36727ef2624ebfce5ed18c859c807574e8966583 100644 (file)
@@ -342,9 +342,14 @@ namespace INTERP_KERNEL
         for(int j = 0 ; j < 2; ++j)
           {
             const int dpIdx = DP_INDEX[3*facets[j] + i];
-            const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx];
-            const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx];
-            c[j] = dpIdx < 0.0 ? 0.0 : sign * calcStableC(seg, dp);
+            if (dpIdx != -1)
+              {
+                const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx];
+                const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx];
+                c[j] = sign * calcStableC(seg, dp);
+              }
+            else
+              c[j] = 0.0;
           }
 
         pt[i] = (c[0] * s[0] + c[1] * s[1]) / denominator;