[pypy-svn] r62741 - pypy/trunk/pypy/translator

fijal at codespeak.net fijal at codespeak.net
Mon Mar 9 00:03:06 CET 2009


Author: fijal
Date: Mon Mar  9 00:03:06 2009
New Revision: 62741

Modified:
   pypy/trunk/pypy/translator/exceptiontransform.py
Log:
A fix. A bit awkward if you ask me, but makes the test pass


Modified: pypy/trunk/pypy/translator/exceptiontransform.py
==============================================================================
--- pypy/trunk/pypy/translator/exceptiontransform.py	(original)
+++ pypy/trunk/pypy/translator/exceptiontransform.py	Mon Mar  9 00:03:06 2009
@@ -170,7 +170,7 @@
         n_gen_exc_checks           = 0
         for block in list(graph.iterblocks()):
             self.replace_stack_unwind(block)
-            self.replace_fetch_restore_operations(block)
+            self.replace_fetch_restore_operations(graph, block)
             need_exc_matching, gen_exc_checks = self.transform_block(graph, block)
             n_need_exc_matching_blocks += need_exc_matching
             n_gen_exc_checks           += gen_exc_checks
@@ -189,7 +189,7 @@
                 block.operations[i].opname = "direct_call"
                 block.operations[i].args = [self.rpyexc_raise_runtime_error_ptr]
 
-    def replace_fetch_restore_operations(self, block):
+    def replace_fetch_restore_operations(self, graph, block):
         # the gctransformer will create these operations.  It looks as if the
         # order of transformations is important - but the gctransformer will
         # put them in a new graph, so all transformations will run again.
@@ -211,6 +211,9 @@
             elif opname == 'raise_exc_value':
                 block.operations[i].opname = 'direct_call'
                 block.operations[i].args.insert(0, self.rpyexc_raise_ptr)
+                del block.operations[i + 1:]
+                l = Link([error_constant(graph.returnblock.inputargs[0].concretetype)], graph.returnblock)
+                block.recloseblock(l)
 
     def transform_block(self, graph, block):
         need_exc_matching = False



More information about the Pypy-commit mailing list