Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: share-guard-info
Changeset: r79765:39aeb22ce4c4
Date: 2015-09-22 13:46 +0200
http://bitbucket.org/pypy/pypy/changeset/39aeb22ce4c4/

Log:    make this jittable

diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py
--- a/pypy/objspace/std/intobject.py
+++ b/pypy/objspace/std/intobject.py
@@ -249,11 +249,17 @@
     ix = 1
     while iw > 0:
         if iw & 1:
-            ix = ovfcheck(ix * temp)
+            try:
+                ix = ovfcheck(ix * temp)
+            except OverflowError:
+                raise
         iw >>= 1   # Shift exponent down by 1 bit
         if iw == 0:
             break
-        temp = ovfcheck(temp * temp) # Square the value of temp
+        try:
+            temp = ovfcheck(temp * temp) # Square the value of temp
+        except OverflowError:
+            raise
         if iz:
             # If we did a multiplication, perform a modulo
             ix %= iz
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to