StackOverflowException in c# when no local variable in the function

Posted by dnkulkarni on Stack Overflow See other posts from Stack Overflow or by dnkulkarni
Published on 2012-03-20T11:24:25Z Indexed on 2012/03/20 11:29 UTC
Read the original article Hit count: 302

Filed under:
|
|

when i do this

static void Main()
{
   Main();
}

I receive stackoverflow exception. As i have read so far about C# they say ONLY local variable of value types (and short living ones) will go on stack.

But here in the code there are no local variable to go on stack then what overflows it ?

I know from assembly code line Perspective that reference to Main() will go on stack too ? Is that right ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about stack