originally I got a stackoverflow exception in x86 mode. As I noticed that x64 would optimize tail recursion so i switched to compile in x64. And it worked out gracefully in debug mode.. However when I tried to run the release code.. it throwed stackoverflow again.. any possible reason?
Share
The rules for when tail recursion optimizations are applied are complicated and ever-changing.
I would strongly recommend that you don’t rely on tail recursion from a correctness point of view.