Author: Armin Rigo <[email protected]>
Branch:
Changeset: r88636:e1ed9c777e87
Date: 2016-11-24 13:45 +0100
http://bitbucket.org/pypy/pypy/changeset/e1ed9c777e87/
Log: ovfcheck() is only for +, - * nowadays
diff --git a/rpython/rlib/rarithmetic.py b/rpython/rlib/rarithmetic.py
--- a/rpython/rlib/rarithmetic.py
+++ b/rpython/rlib/rarithmetic.py
@@ -11,7 +11,7 @@
intmask mask a possibly long value when running on CPython
back to a signed int value
ovfcheck check on CPython whether the result of a signed
- integer operation did overflow
+ integer operation did overflow (add, sub, mul)
ovfcheck_float_to_int
convert to an integer or raise OverflowError
ovfcheck_float_to_longlong
@@ -168,6 +168,7 @@
def ovfcheck(r):
# to be used as ovfcheck(x <op> y)
# raise OverflowError if the operation did overflow
+ # Nowadays, only supports '+', '-' or '*' as the operation.
assert not isinstance(r, r_uint), "unexpected ovf check on unsigned"
assert not isinstance(r, r_longlong), "ovfcheck not supported on
r_longlong"
assert not isinstance(r, r_ulonglong), "ovfcheck not supported on
r_ulonglong"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit