[Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.71,2.72

Tim Peters python-dev@python.org
Mon, 25 Sep 2000 14:01:40 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv28925/python/dist/src/objects

Modified Files:
	floatobject.c 
Log Message:
Replace SIGFPE paranoia around strtod and atof.  I don't believe these
fncs are allowed to raise SIGFPE (see the C std), but OK by me if
people using --with-fpectl want to pay for checking anyway.


Index: floatobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v
retrieving revision 2.71
retrieving revision 2.72
diff -C2 -r2.71 -r2.72
*** floatobject.c	2000/09/23 03:39:17	2.71
--- floatobject.c	2000/09/25 21:01:28	2.72
***************
*** 183,187 ****
--- 183,189 ----
  	 * key off errno.
           */
+ 	PyFPE_START_PROTECT("strtod", return NULL)
  	x = strtod(s, (char **)&end);
+ 	PyFPE_END_PROTECT(x)
  	errno = 0;
  	/* Believe it or not, Solaris 2.6 can move end *beyond* the null
***************
*** 211,215 ****
--- 213,219 ----
  		/* See above -- may have been strtod being anal
  		   about denorms. */
+ 		PyFPE_START_PROTECT("atof", return NULL)
  		x = atof(s);
+ 		PyFPE_END_PROTECT(x)
  		errno = 0;    /* whether atof ever set errno is undefined */
  	}