[pypy-svn] r32192 - pypy/branch/more-gckinds/pypy/rpython

mwh at codespeak.net mwh at codespeak.net
Tue Sep 12 10:31:51 CEST 2006


Author: mwh
Date: Tue Sep 12 10:31:49 2006
New Revision: 32192

Modified:
   pypy/branch/more-gckinds/pypy/rpython/rptr.py
Log:
an arigo-suggested cheat (thanks :)


Modified: pypy/branch/more-gckinds/pypy/rpython/rptr.py
==============================================================================
--- pypy/branch/more-gckinds/pypy/rpython/rptr.py	(original)
+++ pypy/branch/more-gckinds/pypy/rpython/rptr.py	Tue Sep 12 10:31:49 2006
@@ -36,7 +36,7 @@
             return hop.inputarg(hop.r_result, arg=0)
         FIELD_TYPE = getattr(self.lowleveltype.TO, attr)
         if isinstance(FIELD_TYPE, ContainerType):
-            if self.lowleveltype.TO._gckind == 'gc' and FIELD_TYPE._gckind == 'raw' and not isinstance(FIELD_TYPE, OpaqueType):
+            if isinstance(hop.r_result, InteriorPtrRepr):
                 return hop.genop('same_as', [hop.inputarg(self, 0)],
                                  resulttype=self.lowleveltype)
             else:
@@ -101,7 +101,7 @@
         ARRAY = r_ptr.lowleveltype.TO
         ITEM_TYPE = ARRAY.OF
         if isinstance(ITEM_TYPE, ContainerType):
-            if ARRAY._gckind == 'gc' and ITEM_TYPE._gckind == 'raw' and not isinstance(ITEM_TYPE, OpaqueType):
+            if isinstance(hop.r_result, InteriorPtrRepr):
                 v_array, v_index = hop.inputargs(r_ptr, Signed)
                 INTERIOR_PTR_TYPE = r_ptr.lowleveltype._interior_ptr_type_with_index(ITEM_TYPE)
                 v_interior_ptr = hop.genop('malloc', [flowmodel.Constant(INTERIOR_PTR_TYPE, Void)],



More information about the Pypy-commit mailing list