Concept Flow - Stack overflow detection
Start Program
Function Call
Push Stack Frame
Check Stack Pointer
Continue
Return
End
When a function is called, a new stack frame is pushed. The system checks if the stack pointer exceeds the limit. If yes, overflow is detected and handled.