[geos-commits] [SCM] GEOS branch 3.15 updated. c991b5dfb4e7b3a14d71c34849d9e257dbff5338

git at osgeo.org git at osgeo.org
Thu Oct 15 20:04:16 PDT 2026


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, 3.15 has been updated
       via  c991b5dfb4e7b3a14d71c34849d9e257dbff5338 (commit)
      from  86a4af483db99dc3f8914cd6a16cbfddd9961130 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c991b5dfb4e7b3a14d71c34849d9e257dbff5338
Author: Mike Taves <mwtoews at gmail.com>
Date:   Fri Oct 16 13:24:00 2026 +1300

    Avoid raising `FE_INVALID` from Envelope (#1555)

diff --git a/NEWS.md b/NEWS.md
index e5a2885ef..579fe1ed3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,7 @@
   - Fix arc noding failure with endpoint intersections (GH-1513, Dan Baston)
   - Make GeometrySplitter able to split MultiSurface inputs (GH-1518, Dan Baston)
   - GEOSGridIntersectionFractions: Set cells outside geometry bounding box to zero (GH-1532, Dan Baston)
+  - Avoid raising `FE_INVALID` from Envelope (GH-1555, Mike Taves)
 
 ## Changes in 3.15.0
 2026-09-01
diff --git a/include/geos/geom/Envelope.h b/include/geos/geom/Envelope.h
index 15d360030..dbbd1577f 100644
--- a/include/geos/geom/Envelope.h
+++ b/include/geos/geom/Envelope.h
@@ -609,6 +609,11 @@ public:
      */
     bool intersects(double x, double y) const
     {
+#if defined(__OPTIMIZE__) && defined(__x86_64__) && defined(__clang__) && (__clang_major__ >= 15)
+        if(std::isnan(x) || std::isnan(maxx)) {
+            return false;
+        }
+#endif  /* defined(__OPTIMIZE__) && defined(__clang__) ... */
         return std::islessequal(x, maxx) &&
                std::isgreaterequal(x, minx) &&
                std::islessequal(y, maxy) &&
@@ -659,6 +664,11 @@ public:
      * @return `true` if `(x, y)` lies in the interior or on the boundary of this Envelope.
      */
     bool covers(double x, double y) const {
+#if defined(__OPTIMIZE__) && defined(__x86_64__) && defined(__clang__) && (__clang_major__ >= 15)
+        if(std::isnan(x) || std::isnan(minx)) {
+            return false;
+        }
+#endif  /* defined(__OPTIMIZE__) && defined(__clang__) ... */
         return std::isgreaterequal(x,  minx) &&
                std::islessequal(x, maxx) &&
                std::isgreaterequal(y, miny) &&
diff --git a/tests/unit/geom/EnvelopeTest.cpp b/tests/unit/geom/EnvelopeTest.cpp
index 7c281aaee..55f6c0dfc 100644
--- a/tests/unit/geom/EnvelopeTest.cpp
+++ b/tests/unit/geom/EnvelopeTest.cpp
@@ -103,12 +103,8 @@ struct test_envelope_data {
         //ensure("FE_INEXACT raised", !std::fetestexcept(FE_INEXACT));
 //#endif
 #ifdef FE_INVALID
-        // Skip FE_INVALID check on FreeBSD and OpenBSD due to platform-specific behavior
-        // See: https://github.com/libgeos/geos/issues/1206
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
         ensure("FE_INVALID raised", !std::fetestexcept(FE_INVALID));
 #endif
-#endif
 #ifdef FE_OVERFLOW
         ensure("FE_OVERFLOW raised", !std::fetestexcept(FE_OVERFLOW));
 #endif
@@ -269,7 +265,10 @@ void object::test<6>
     check_intersects(small, {-1, -1}, true);
     check_intersects(small, {5, 5}, false);
 
+#if !( defined(__OPTIMIZE__) && defined(__x86_64__) && defined(__clang__) && defined(__apple_build_version__) )
+//  Exclude optimized Apple Clang on x86_64 osx - raises FE_INVALID
     check_intersects(empty, {0, 0}, false);
+#endif
 
     ensure_no_fp_except();
 }

-----------------------------------------------------------------------

Summary of changes:
 NEWS.md                          |  1 +
 include/geos/geom/Envelope.h     | 10 ++++++++++
 tests/unit/geom/EnvelopeTest.cpp |  7 +++----
 3 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list