4 ms·
If you are trying to suggest that the stack is runtime unpredictable like a hard drive, overflowing it would be an error, not an exception. Therefore, a suffic
by randomdata 3y ago
If you are trying to suggest that the stack is runtime unpredictable like a hard drive, overflowing it would be an error, not an exception.
Therefore, a sufficiently smart compiler just needs to ensure that you have done the proper accounting of stack use and handle the error condition if you are approaching an overflow state. With that, you can prevent it becoming an exception.
If you encounter a stack overflow exception, it is because you didn't do your due diligence. Technically your program is flawed. Granted, the pragmatic engineer probably doesn't care about correctness in that area. It turns out not all programs have to be perfect to be useful.
No fame for me, I'm afraid. There is nothing here out of the ordinary.