[pypy-commit] pypy stringbuilder2-perf: Remove these hacks, not necessary any more

arigo noreply at buildbot.pypy.org
Sun Jun 15 16:17:14 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stringbuilder2-perf
Changeset: r72064:64569e9d9e0b
Date: 2014-06-15 16:16 +0200
http://bitbucket.org/pypy/pypy/changeset/64569e9d9e0b/

Log:	Remove these hacks, not necessary any more

diff --git a/rpython/rtyper/lltypesystem/ll2ctypes.py b/rpython/rtyper/lltypesystem/ll2ctypes.py
--- a/rpython/rtyper/lltypesystem/ll2ctypes.py
+++ b/rpython/rtyper/lltypesystem/ll2ctypes.py
@@ -1336,10 +1336,6 @@
     """
     T = lltype.typeOf(ptr)
     typecheck_ptradd(T)
-    if not ptr and T.TO.OF == lltype.Char:
-        # special-case: support 'NULL + real_address_as_int'
-        assert not (0 <= n < 4096)
-        return force_cast(T, n)
     ctypes_item_type = get_ctypes_type(T.TO.OF)
     ctypes_arrayptr_type = get_ctypes_type(T)
     cptr = lltype2ctypes(ptr)
diff --git a/rpython/rtyper/lltypesystem/opimpl.py b/rpython/rtyper/lltypesystem/opimpl.py
--- a/rpython/rtyper/lltypesystem/opimpl.py
+++ b/rpython/rtyper/lltypesystem/opimpl.py
@@ -180,10 +180,11 @@
     checkptr(obj)
     assert is_valid_int(index)
     if not obj:
-        assert isinstance(index, int)
-        assert not (0 <= index < 4096)
-        from rpython.rtyper.lltypesystem import rffi
-        return rffi.cast(lltype.typeOf(obj), index)
+        raise AssertionError("direct_ptradd on null pointer")
+        ## assert isinstance(index, int)
+        ## assert not (0 <= index < 4096)
+        ## from rpython.rtyper.lltypesystem import rffi
+        ## return rffi.cast(lltype.typeOf(obj), index)
     return lltype.direct_ptradd(obj, index)
 
 


More information about the pypy-commit mailing list