Commit bb50fb51 authored by Bruce Momjian's avatar Bruce Momjian

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.
parent 04c78e2e
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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,6 +876,9 @@ line_construct_pm(Point *pt, double m) ...@@ -876,6 +876,9 @@ line_construct_pm(Point *pt, double m)
/* use "mx - y + yinter = 0" */ /* use "mx - y + yinter = 0" */
result->A = m; result->A = m;
result->B = -1.0; result->B = -1.0;
if (m==DBL_MAX)
result->C = pt->y;
else
result->C = pt->y - m * pt->x; result->C = pt->y - m * pt->x;
#ifdef NOT_USED #ifdef NOT_USED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment