[pypy-svn] r67130 - in pypy/branch/pyjitpl5/pypy/rpython: . test

pedronis at codespeak.net pedronis at codespeak.net
Sun Aug 23 18:48:48 CEST 2009


Author: pedronis
Date: Sun Aug 23 18:48:48 2009
New Revision: 67130

Modified:
   pypy/branch/pyjitpl5/pypy/rpython/rvirtualizable2.py
   pypy/branch/pyjitpl5/pypy/rpython/test/test_rvirtualizable2.py
Log:
(cfbolz, pedronis)

test and fix



Modified: pypy/branch/pyjitpl5/pypy/rpython/rvirtualizable2.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/rvirtualizable2.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/rvirtualizable2.py	Sun Aug 23 18:48:48 2009
@@ -60,6 +60,8 @@
     count = 0
     for graph in graphs:
         for block in graph.iterblocks():
+            if not block.operations:
+                continue
             newoplist = []
             for i, op in enumerate(block.operations):
                 if (op.opname == 'promote_virtualizable' and

Modified: pypy/branch/pyjitpl5/pypy/rpython/test/test_rvirtualizable2.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/test/test_rvirtualizable2.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/test/test_rvirtualizable2.py	Sun Aug 23 18:48:48 2009
@@ -168,6 +168,27 @@
         res = self.interpret(f, [23]) 
         assert res == 23
 
+    def test_access_directly_exception(self):
+        def g(b):
+            return b.v0
+
+        def f(n):
+            b = B(n)
+            b = hint(b, access_directly=True)
+            if not b.v0:
+                raise Exception
+            return g(b)
+
+        t, typer, graph = self.gengraph(f, [int])
+        f_graph = t._graphof(f)
+        g_graph = t._graphof(g)
+
+        self.replace_promote_virtualizable(typer, [f_graph, g_graph])
+        t.checkgraphs()
+
+        res = self.interpret(f, [23]) 
+        assert res == 23
+
     def test_access_directly_specialized(self):
         def g(b):
             return b.v0



More information about the Pypy-commit mailing list