[pypy-svn] r22841 - pypy/dist/pypy/rpython/memory

mwh at codespeak.net mwh at codespeak.net
Sun Jan 29 15:03:38 CET 2006


Author: mwh
Date: Sun Jan 29 15:03:37 2006
New Revision: 22841

Modified:
   pypy/dist/pypy/rpython/memory/gctransform.py
Log:
admit that, for now, any operation can potentially raise an exception.
decref last_exception if needed too (only in the pyobject case, most
likely).  this is broken in combination with what's on the branch now
but not for long.


Modified: pypy/dist/pypy/rpython/memory/gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform.py	(original)
+++ pypy/dist/pypy/rpython/memory/gctransform.py	Sun Jan 29 15:03:37 2006
@@ -82,7 +82,7 @@
         livevars = [var for var in block.inputargs if var_needsgc(var)]
         for op in block.operations:
             newops.extend(self.replacement_operations(op))
-            if op.opname in EXCEPTION_RAISING_OPS and livevars:
+            if 1 or op.opname in EXCEPTION_RAISING_OPS:
                 cleanup_on_exception = []
                 for var in livevars:
                     cleanup_on_exception.extend(self.pop_alive(var))
@@ -116,7 +116,9 @@
                         # exception, it can't have returned anything that
                         # might need pop_aliving.
                         del livecounts[livevars[-1]]
-                    livecounts[link.last_exc_value] = 1
+                    for v in link.last_exception, link.last_exc_value:
+                        if var_needsgc(v):
+                            livecounts[v] = 1
                 for v in link.args:
                     if v in livecounts:
                         livecounts[v] -= 1



More information about the Pypy-commit mailing list