summaryrefslogtreecommitdiffstats
path: root/Modules/mpzmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-02-14 22:59:58 (GMT)
committerGuido van Rossum <guido@python.org>1997-02-14 22:59:58 (GMT)
commit52fa3a69090ac098b01b28f397d9bd08f957e8cd (patch)
treec01e3347c776bd8f5deb93af7e90cfca37dea8eb /Modules/mpzmodule.c
parent0ae748d3c409fc4b870baadd601a53c6a43ddf11 (diff)
downloadcpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.zip
cpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.tar.gz
cpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.tar.bz2
Changes for Lee Busby's SIGFPE patch set.
Two new modules fpectl and fpetest. Surround various and sundry f.p. operations with PyFPE_*_PROTECT macros.
Diffstat (limited to 'Modules/mpzmodule.c')
-rw-r--r--Modules/mpzmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c
index 1f356e1..bf83109 100644
--- a/Modules/mpzmodule.c
+++ b/Modules/mpzmodule.c
@@ -1488,6 +1488,8 @@ mpz_float(self)
/* let those bits come, let those bits go,
e.g. dismantle mpzscratch, build PyFloatObject */
+ /* Can this overflow? Dunno, protect against that possibility. */
+ PyFPE_START_PROTECT("mpz_float", return 0)
x = 0.0;
mulstate = 1.0;
while (i--) {
@@ -1495,6 +1497,7 @@ mpz_float(self)
mulstate *= multiplier;
mpz_div_2exp(&mpzscratch, &mpzscratch, BITS_PER_MP_LIMB);
}
+ PyFPE_END_PROTECT
assert(mpz_cmp_ui(&mpzscratch, (unsigned long int)0) == 0);
mpz_clear(&mpzscratch);