Author: Christian Tismer <[email protected]>
Branch: win64-stage1
Changeset: r49916:dc399690828c
Date: 2011-11-28 16:27 +0100
http://bitbucket.org/pypy/pypy/changeset/dc399690828c/

Log:    simple but ugly hack to make 'test_mod_ovf_zer' pass. ovfcheck(x %
        y) does not help when int and long are unified. So we check on (x //
        y) but use (x % y)

diff --git a/pypy/rpython/llinterp.py b/pypy/rpython/llinterp.py
--- a/pypy/rpython/llinterp.py
+++ b/pypy/rpython/llinterp.py
@@ -1057,7 +1057,9 @@
                 return r
                 '''%locals()
         elif operator == '%':
-            code = '''r = %(checkfn)s(x %% y)
+            ## overflow check on % does not work with emulated int
+            code = '''%(checkfn)s(x // y)
+                r = x %% y
                 if x^y < 0 and x%%y != 0:
                     r -= y
                 return r
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to