[pypy-svn] r24850 - pypy/branch/explicit-exceptions/translator/c

mwh at codespeak.net mwh at codespeak.net
Thu Mar 23 02:11:13 CET 2006


Author: mwh
Date: Thu Mar 23 02:11:12 2006
New Revision: 24850

Modified:
   pypy/branch/explicit-exceptions/translator/c/exceptiontransform.py
Log:
try harder to hang on the block with the guarded operation (if any) in it.


Modified: pypy/branch/explicit-exceptions/translator/c/exceptiontransform.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/c/exceptiontransform.py	(original)
+++ pypy/branch/explicit-exceptions/translator/c/exceptiontransform.py	Thu Mar 23 02:11:12 2006
@@ -106,7 +106,7 @@
             last_operation -= 1
         else:
             need_exc_matching = False
-        afterblock = block
+        lastblock = block
         for i in range(last_operation, -1, -1):
             op = block.operations[i]
             print "considering op", op, i
@@ -114,19 +114,21 @@
                 continue
 
             afterblock = split_block(self.translator, graph, block, i+1)
+            if lastblock is block:
+                lastblock = afterblock
 
             self.gen_exc_check(block, graph.returnblock)
 
             #non-exception case
             block.exits[0].exitcase = block.exits[0].llexitcase = False
         if need_exc_matching:
-            assert afterblock.exitswitch == c_last_exception
-            if not self.raise_analyzer.can_raise(afterblock.operations[-1]):
-                print "XXX: operation %s cannot raise, but has exception guarding in graph %s" % (afterblock.operations[-1], graph)
-                afterblock.exitswitch = None
-                afterblock.exits = [afterblock.exits[0]]
+            assert lastblock.exitswitch == c_last_exception
+            if 0 and not self.raise_analyzer.can_raise(lastblock.operations[-1]):
+                print "XXX: operation %s cannot raise, but has exception guarding in graph %s" % (lastblock.operations[-1], graph)
+                lastblock.exitswitch = None
+                lastblock.exits = [lastblock.exits[0]]
             else:
-                self.insert_matching(afterblock, graph)
+                self.insert_matching(lastblock, graph)
 
     def transform_except_block(self, graph, block):
         # attach an except block -- let's hope that nobody uses it



More information about the Pypy-commit mailing list