[Mono-dev] About recursivily and setters / getters
romain at blogreen.org
Sun Sep 6 17:10:31 EDT 2009
On Sun, Sep 06, 2009 at 09:58:08PM +0100, Tom Spink wrote:
> 2009/9/6 Romain Tartière <romain at blogreen.org>:
> > I guess this crash is somewhat violent. Should a bug be opened for
> > this? Any comment?
> It's crashing because it's a stack overflow. A recursive call will
> never result in an infinite loop, because each call to itself pushes a
> new stack frame onto the stack. Eventually (well, quite quickly in
> fact!), the stack will fill up and you'll get a stack overflow
> (which is what I get, when I execute your program on my system)
Wow... I tested too fast with a wrong code... You are totally right,
there is no problem here, just a stack overflow. If I fix my ugly
example (x = x - 1; return Even) it does what is expected.
I need sleep or coffee I guess.
Romain Tartière <romain at blogreen.org> http://romain.blogreen.org/
pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090906/cd80b2d8/attachment.bin
More information about the Mono-devel-list