![]() ![]() However, also note that sometimes you want things to run indefinitely (such as the main loop in a web server).Īlso interesting. This doesn't mean you can't do any analysis in fact, you can do quite a bit of analysis. This is definitely not done by compilers. Which is by the way an undecidable problem. ![]() :-)īasically detecting all infinite loops requires you to solve the Halting Problem. Well now, here's a question I haven't heard for a while. ![]() In most languages, each thread has its own stack. To clarify about this 'boundary check': the way these checks are done is normally by using guard pages this means boundary checks aren't normally implemented as if-then-else checks (although some implementations exist.). bytes used) - and if it hits a boundary, give an error. The easiest way to detect a stack overflow is to check your current stack depth (e.g. (Note: I explicitly say 'recursion' here and not 'tail recursion' the latter works like a 'goto' and doesn't grow the stack). Note that recursion isn't normally 'inlined'. If you call a method, you push stuff on the stack if you return, you pop stuff from the stack. ![]() Note that I will generalize quite a bit here.Īs you might know, most languages use the stack for storing call information. I'll make it easy for you but this is actually quite complex. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |