aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-12-21 17:01:44 +0000
committerBruce Momjian <bruce@momjian.us>1999-12-21 17:01:44 +0000
commitbb50fb517f9f2a09891425173aeb150c07126778 (patch)
tree664698a8aa1ef2f172d2240167425d260975828e
parent04c78e2eb45ec20e02abd0aee1b8a59068ee26c1 (diff)
downloadpostgresql-bb50fb517f9f2a09891425173aeb150c07126778.tar.gz
postgresql-bb50fb517f9f2a09891425173aeb150c07126778.zip
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.
-rw-r--r--src/backend/utils/adt/geo_ops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 7bb2aba7adc..b56b7f5d8da 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.45 1999/07/17 20:17:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.46 1999/12/21 17:01:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -876,7 +876,10 @@ line_construct_pm(Point *pt, double m)
/* use "mx - y + yinter = 0" */
result->A = m;
result->B = -1.0;
- result->C = pt->y - m * pt->x;
+ if (m==DBL_MAX)
+ result->C = pt->y;
+ else
+ result->C = pt->y - m * pt->x;
#ifdef NOT_USED
result->m = m;