]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix zero division checks: return if it occurs!
authorGuido van Rossum <guido@python.org>
Fri, 26 Oct 1990 14:58:41 +0000 (14:58 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 26 Oct 1990 14:58:41 +0000 (14:58 +0000)
Objects/intobject.c

index 2cf9439b7e7a9dc45e2bb9ed85b6ca36d08c21ec..b0dd03658a81179102f422bc3aa553fc91f17dfb 100644 (file)
@@ -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? */