Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r85888:59fd099ef96e
Date: 2016-07-28 10:18 +0200
http://bitbucket.org/pypy/pypy/changeset/59fd099ef96e/

Log:    More carefully check the range of the 'long' integer given to
        lltype.typeOf()

diff --git a/rpython/rtyper/lltypesystem/lltype.py 
b/rpython/rtyper/lltypesystem/lltype.py
--- a/rpython/rtyper/lltypesystem/lltype.py
+++ b/rpython/rtyper/lltypesystem/lltype.py
@@ -812,8 +812,10 @@
         if tp is long:
             if -maxint-1 <= val <= maxint:
                 return Signed
+            elif longlongmask(val) == val:
+                return SignedLongLong
             else:
-                return SignedLongLong
+                raise OverflowError("integer %r is out of bounds" % (val,))
         if tp is bool:
             return Bool
         if issubclass(tp, base_int):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to