summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-02-14 22:54:21 (GMT)
committerGuido van Rossum <guido@python.org>1997-02-14 22:54:21 (GMT)
commit09e6ad0c1e1c7b3c6132ab2d5dd85c5cc376721d (patch)
tree14e706bc51e07d8056abfcd70f542c0cb009591b /Objects/longobject.c
parent7d4266ed5a68e4434a86a11eb771abb28d13322e (diff)
downloadcpython-09e6ad0c1e1c7b3c6132ab2d5dd85c5cc376721d.zip
cpython-09e6ad0c1e1c7b3c6132ab2d5dd85c5cc376721d.tar.gz
cpython-09e6ad0c1e1c7b3c6132ab2d5dd85c5cc376721d.tar.bz2
Changes for Lee Busby's SIGFPE patch set.
Surround various f.p. operations with PyFPE_{START,END}_PROTECT macros.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 36f2a26..e0255e9 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -237,7 +237,7 @@ PyLong_AsUnsignedLong(vv)
return x;
}
-/* Get a C double from a long int object. No overflow check. */
+/* Get a C double from a long int object. */
double
dgetlongvalue(vv)
@@ -1418,7 +1418,11 @@ static object *
long_float(v)
object *v;
{
- return newfloatobject(dgetlongvalue(v));
+ double result;
+ PyFPE_START_PROTECT("long_float", return 0)
+ result = dgetlongvalue(v);
+ PyFPE_END_PROTECT
+ return newfloatobject(result);
}
static object *