Author: Tim Felgentreff <[email protected]>
Branch: 
Changeset: r323:49e6a94b64d1
Date: 2013-04-23 18:10 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/49e6a94b64d1/

Log:    (lwassermann, timfel) use ovfcheck_float_to_int

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -286,8 +286,10 @@
 
 @expose_primitive(FLOAT_TRUNCATED, unwrap_spec=[float])
 def func(interp, s_frame, f):
-    w_res = interp.space.wrap_int(int(f))
-    return w_res
+    try:
+        return interp.space.wrap_int(rarithmetic.ovfcheck_float_to_int(f))
+    except OverflowError:
+        raise PrimitiveFailedError
 
 @expose_primitive(FLOAT_TIMES_TWO_POWER, unwrap_spec=[float, int])
 def func(interp, s_frame, rcvr, arg):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to