I wonder why it catches StackOverflowException before it terminates. I believe there is no local variable declared that is supposed to be stored on stack in "static void Recursive()" function. Could anyone please explain how StackOveflowException occurs in details in this case?
Thanks
class program
{
static void Main(string[] args)
{
Recursive();
}
static void Recursive()
{
Recursive();
}
}
I am wondering why it catches StackOverflowException
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Mar 14, 2011, 12:31 PM EDT
Even if there are no local variables or parameters, the stack frame will contain the return address when the method terminates at the very least.