[pypy-issue] [issue1461] new style class recursive __call__ doesn't trigger a RuntimeError on windows

Armin Rigo tracker at bugs.pypy.org
Tue Apr 23 09:34:13 CEST 2013


Armin Rigo <armin.rigo at gmail.com> added the comment:

The reason is in rpython/translator/c/src/stack.h: you need a macro
PYPY_INHIBIT_TAIL_CALL().  Without it, the C code compiles too many tail calls.
 This test is precisely checking a particular path that does only tail calls at
the C levels.  An optimizing compiler replaces them all with jumps, and then
runs the seemingly infinite number of nested C calls in a finite amount of C stack.

There are probably portable ways to write the macro.

----------
nosy: +arigo

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1461>
________________________________________


More information about the pypy-issue mailing list