Skip to content

Commit bb50fb5

Browse files
committed
This patch will avoid SIGFPE on some geo functions , if PostgreSQL is compiled
with DEC C. DEC C doesn't handle double values greater than DBL_MAX, but some PostgreSQL geo functions assign greater than DBL_MAX values to some vars in some special cases - that couses SIGFPE. I dunno if that is the only place to fix to work well with DEC C. Kirill Nosov.
1 parent 04c78e2 commit bb50fb5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/adt/geo_ops.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.45 1999/07/17 20:17:56 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.46 1999/12/21 17:01:44 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -876,7 +876,10 @@ line_construct_pm(Point *pt, double m)
876876
/* use "mx - y + yinter = 0" */
877877
result->A = m;
878878
result->B = -1.0;
879-
result->C = pt->y - m * pt->x;
879+
if (m==DBL_MAX)
880+
result->C = pt->y;
881+
else
882+
result->C = pt->y - m * pt->x;
880883

881884
#ifdef NOT_USED
882885
result->m = m;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy