[pypy-svn] r24898 - pypy/branch/explicit-exceptions/translator/c
mwh at codespeak.net
mwh at codespeak.net
Thu Mar 23 18:40:15 CET 2006
Author: mwh
Date: Thu Mar 23 18:40:14 2006
New Revision: 24898
Modified:
pypy/branch/explicit-exceptions/translator/c/funcgen.py
Log:
convert rpython exceptions to cpython exceptions in wrapper functions. now all
test_exceptiontransform.py tests passes, but i'm getting strange segfaults in
test_newgc...
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 Thu Mar 23 18:40:14 2006
@@ -188,6 +188,12 @@
if len(block.exits) == 0:
assert len(block.inputargs) == 1
# regular return block
+ if self.cpython_exc:
+ assert self.lltypemap(self.graph.getreturnvar()) == PyObjPtr
+ yield 'if (RPyExceptionOccurred()) {'
+ yield '\tRPyConvertExceptionToCPython(rpython_exc_value);'
+ yield '\treturn NULL;'
+ yield '}'
retval = self.expr(block.inputargs[0])
yield 'return %s;' % retval
continue
More information about the Pypy-commit
mailing list