[pypy-svn] r68319 - pypy/trunk/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Sun Oct 11 19:45:03 CEST 2009


Author: arigo
Date: Sun Oct 11 19:45:02 2009
New Revision: 68319

Modified:
   pypy/trunk/pypy/jit/metainterp/executor.py
Log:
Obscure workaround.


Modified: pypy/trunk/pypy/jit/metainterp/executor.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/executor.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/executor.py	Sun Oct 11 19:45:02 2009
@@ -235,7 +235,9 @@
     return ConstInt(box1.getfloat() >= box2.getfloat())
 
 def do_cast_float_to_int(cpu, box1):
-    return ConstInt(int(box1.getfloat()))
+    # note: we need to call int() twice to care for the fact that
+    # int(-2147483648.0) returns a long :-(
+    return ConstInt(int(int(box1.getfloat())))
 
 def do_cast_int_to_float(cpu, box1):
     return ConstFloat(float(box1.getint()))



More information about the Pypy-commit mailing list