[pypy-svn] r69069 - in pypy/trunk/pypy/jit/metainterp: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Sun Nov 8 17:17:53 CET 2009


Author: cfbolz
Date: Sun Nov  8 17:17:52 2009
New Revision: 69069

Modified:
   pypy/trunk/pypy/jit/metainterp/effectinfo.py
   pypy/trunk/pypy/jit/metainterp/test/test_effectinfo.py
Log:
there are Void fields too. It's very funny how this thing with Voids goes on and
on and on.


Modified: pypy/trunk/pypy/jit/metainterp/effectinfo.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/effectinfo.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/effectinfo.py	Sun Nov  8 17:17:52 2009
@@ -25,6 +25,8 @@
             _, T, fieldname = tup
             if not isinstance(T.TO, lltype.GcStruct): # can be a non-GC-struct
                 continue
+            if getattr(T.TO, fieldname) is lltype.Void:
+                continue
             if fieldname == "typeptr" and T.TO is OBJECT:
                 # filter out the typeptr, because
                 # a) it is optimized in different ways

Modified: pypy/trunk/pypy/jit/metainterp/test/test_effectinfo.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_effectinfo.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_effectinfo.py	Sun Nov  8 17:17:52 2009
@@ -13,3 +13,9 @@
     effectinfo = effectinfo_from_writeanalyze(effects, None)
     assert not effectinfo.write_descrs_fields
     assert not effectinfo.write_descrs_arrays
+
+def test_filter_out_struct_with_void():
+    effects = frozenset([("struct", lltype.Ptr(lltype.GcStruct("x", ("a", lltype.Void))), "a")])
+    effectinfo = effectinfo_from_writeanalyze(effects, None)
+    assert not effectinfo.write_descrs_fields
+    assert not effectinfo.write_descrs_arrays



More information about the Pypy-commit mailing list