Killing Possible Stack Overflows

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Killing Possible Stack Overflows

Post by ~ »

One of the things that are more susceptible to cause stack overflows are recurrent calls to routines.

If the stack is used mainly to keep the addresses of returning calls, it could be a good option to limit the number of calls to a safe recurrent depth, like no more than 512 calls, and have a wrapper that, when this number is reached, refuses to keep calling and end the program.
Post Reply