summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-10-26 14:58:41 (GMT)
committerGuido van Rossum <guido@python.org>1990-10-26 14:58:41 (GMT)
commitabbda16f5834c314c85ff495af277de744dc5587 (patch)
treed8de15a3ea706f6541d1e84299de3cb45fe59d0a /Objects
parentdd5c7be5680375cc33f9ec71dee7ed392e894f9c (diff)
downloadcpython-abbda16f5834c314c85ff495af277de744dc5587.zip
cpython-abbda16f5834c314c85ff495af277de744dc5587.tar.gz
cpython-abbda16f5834c314c85ff495af277de744dc5587.tar.bz2
Fix zero division checks: return if it occurs!
Diffstat (limited to 'Objects')
-rw-r--r--Objects/intobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 2cf9439..b0dd036 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -156,7 +156,7 @@ intdiv(v, w)
return NULL;
}
if (((intobject *)w) -> ob_ival == 0)
- err_zdiv();
+ return err_zdiv();
return newintobject(v->ob_ival / ((intobject *)w) -> ob_ival);
}
@@ -170,7 +170,7 @@ intrem(v, w)
return NULL;
}
if (((intobject *)w) -> ob_ival == 0)
- err_zdiv();
+ return err_zdiv();
return newintobject(v->ob_ival % ((intobject *)w) -> ob_ival);
}
@@ -195,7 +195,7 @@ intpow(v, w)
ix = ix * iv;
if (neg) {
if (ix == 0)
- err_zdiv();
+ return err_zdiv();
ix = 1/ix;
}
/* XXX How to check for overflow? */