[pypy-svn] r24640 - in pypy/dist/pypy/rpython/memory: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Mon Mar 20 20:17:16 CET 2006
Author: cfbolz
Date: Mon Mar 20 20:17:14 2006
New Revision: 24640
Modified:
pypy/dist/pypy/rpython/memory/gctransform.py
pypy/dist/pypy/rpython/memory/test/test_gctransform.py
Log:
reverted checkin r24534 since it broke tests translator/c/test_newgc.py and
translator/c/test_extfunc.py. No gc(un)protect gets exception handling attached
again, this will have to be fixed after the refactoring of the gc transformer.
Modified: pypy/dist/pypy/rpython/memory/gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform.py (original)
+++ pypy/dist/pypy/rpython/memory/gctransform.py Mon Mar 20 20:17:14 2006
@@ -103,9 +103,9 @@
# seem to run into all the same problems as the ones we already
# had to solve there.
has_exception_handler = block.exitswitch == c_last_exception
- for i, origop in enumerate(block.operations):
+ for i, op in enumerate(block.operations):
num_ops_after_exc_raising = 0
- res = self.replacement_operations(origop, livevars, block)
+ res = self.replacement_operations(op, livevars, block)
try:
ops, cleanup_before_exception = res
except ValueError:
@@ -113,16 +113,17 @@
if not ops:
continue # may happen when we eat gc_protect/gc_unprotect.
newops.extend(ops)
+ origname = op.opname
op = ops[-1-num_ops_after_exc_raising]
# look into the table of all operations to check whether op is
# expected to raise. if it is not in the table or the last
# operation in a block with exception catching, we assume it can
if (op.opname not in LL_OPERATIONS or
+ op.opname not in NEVER_RAISING_OPS or
(has_exception_handler and i == len(block.operations) - 1)):
can_raise = True
else:
- can_raise = (LL_OPERATIONS[op.opname].canraise and
- origop.opname not in NEVER_RAISING_OPS)
+ can_raise = bool(LL_OPERATIONS[op.opname].canraise)
if can_raise:
if tuple(livevars) in livevars2cleanup:
cleanup_on_exception = livevars2cleanup[tuple(livevars)]
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 Mon Mar 20 20:17:14 2006
@@ -253,7 +253,7 @@
has_cleanup = False
ops = getops(graphof(t, f))
for op in ops.get('direct_call', []):
- assert not op.cleanup
+ assert op.cleanup is None or op.cleanup == ((), ())
# end of protection tests
More information about the Pypy-commit
mailing list