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

mwh at codespeak.net mwh at codespeak.net
Fri Mar 24 13:05:33 CET 2006


Author: mwh
Date: Fri Mar 24 13:05:27 2006
New Revision: 24951

Modified:
   pypy/branch/explicit-exceptions/translator/c/exceptiontransform.py
   pypy/branch/explicit-exceptions/translator/c/funcgen.py
Log:
small changes to make stackless work again.

slightly hackish, stackless is getting slightly 'old-fashioned' in a pypy
sense, it should probably be done as a graph transformation or something.

still works though...


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	Fri Mar 24 13:05:27 2006
@@ -211,6 +211,9 @@
         startblock = Block(inputargs)
         startblock.operations.append(newop) 
         newgraph = FunctionGraph("dummy_exc1", startblock)
+        # XXX this is makes stackless happier, for very bad reasons.
+        # XXX do something about this.
+        newgraph.func = None
         startblock.closeblock(Link([result], newgraph.returnblock))
         startblock.exits = list(startblock.exits)
         newgraph.returnblock.inputargs[0].concretetype = op.result.concretetype

Modified: pypy/branch/explicit-exceptions/translator/c/funcgen.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/c/funcgen.py	(original)
+++ pypy/branch/explicit-exceptions/translator/c/funcgen.py	Fri Mar 24 13:05:27 2006
@@ -347,6 +347,9 @@
             # skip assignment of 'void' return value
             r = self.expr(op.result)
             line = '%s = %s' % (r, line)
+        check = self.check_directcall_result(op, err)
+        if check:
+            return line + '\n' + check
         return line
 
     # the following works since the extra arguments that indirect_call has
@@ -354,7 +357,7 @@
     OP_INDIRECT_CALL = OP_DIRECT_CALL
 
     def check_directcall_result(self, op, err):
-        return 'if (RPyExceptionOccurred())\n\tFAIL(%s);' % err
+        return None
 
     # low-level operations
     def generic_get(self, op, sourceexpr):



More information about the Pypy-commit mailing list