On 4/18/06, Armin Rigo <[EMAIL PROTECTED]> wrote:
> Hi Brett,
>
> On Mon, Apr 17, 2006 at 05:34:16PM -0700, Brett Cannon wrote:
> > + if (meth == self) {
> > + PyErr_SetString(PyExc_RuntimeError,
> > + "recursive __call__ definition");
> > +
Hi Brett,
On Mon, Apr 17, 2006 at 05:34:16PM -0700, Brett Cannon wrote:
> + if (meth == self) {
> + PyErr_SetString(PyExc_RuntimeError,
> + "recursive __call__ definition");
> + return NULL;
> + }
This is not the proper way, as
Bug 532646 is a check for recursive __call__ methods where it is just
set to an instance of the same class::
class A:
pass
A.__call__ = A()
a = A()
try:
a() # This should not segfault
except RuntimeError:
pass
else:
raise TestFailed, "how could this not have overflowed the stack?"