Author: fijal
Branch: jit-leaner-frontend
Changeset: r83349:3fe35633374e
Date: 2016-03-25 13:47 +0200
http://bitbucket.org/pypy/pypy/changeset/3fe35633374e/

Log:    improve casts

diff --git a/rpython/jit/metainterp/opencoder.py 
b/rpython/jit/metainterp/opencoder.py
--- a/rpython/jit/metainterp/opencoder.py
+++ b/rpython/jit/metainterp/opencoder.py
@@ -26,6 +26,11 @@
 MIN_SHORT = 0
 MAX_SHORT = 2**16 - 1
 
+def expand_sizes_to_signed():
+    """ This function will make sure we can use sizes all the
+    way up to lltype.Signed for indexes everywhere
+    """
+
 class FrontendTagOverflow(Exception):
     pass
 
@@ -464,7 +469,7 @@
 def tag(kind, pos):
     #if not SMALL_INT_START <= pos < SMALL_INT_STOP:
     #    raise some error
-    return (pos << TAGSHIFT) | kind
+    return rffi.cast(STORAGE_TP, (pos << TAGSHIFT) | kind)
 
 def untag(tagged):
     return intmask(tagged) & TAGMASK, intmask(tagged) >> TAGSHIFT
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to