[pypy-svn] r31711 - pypy/dist/pypy/rpython/memory/test

mwh at codespeak.net mwh at codespeak.net
Sun Aug 27 12:46:39 CEST 2006


Author: mwh
Date: Sun Aug 27 12:46:39 2006
New Revision: 31711

Modified:
   pypy/dist/pypy/rpython/memory/test/test_gctransform.py
Log:
make sure the machinery sees types realistically early in the tests to avoid
funny annotation reentry problems.


Modified: pypy/dist/pypy/rpython/memory/test/test_gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/test/test_gctransform.py	(original)
+++ pypy/dist/pypy/rpython/memory/test/test_gctransform.py	Sun Aug 27 12:46:39 2006
@@ -438,13 +438,18 @@
 def make_deallocator(TYPE,
                      attr="static_deallocation_funcptr_for_type",
                      cls=gctransform.RefcountingGCTransformer):
-    def f():
-        pass
+    if TYPE._is_varsize():
+        def f():
+            return lltype.malloc(TYPE, 1)
+    else:
+        def f():
+            return lltype.malloc(TYPE)
     t = TranslationContext()
     t.buildannotator().build_types(f, [])
     t.buildrtyper().specialize()
     transformer = cls(t)
     fptr = getattr(transformer, attr)(TYPE)
+    transformer.transform_graph(graphof(t, f))
     transformer.finish()
     if conftest.option.view:
         t.view()



More information about the Pypy-commit mailing list