[fpc-pascal] detecting recursive loops

leledumbo leledumbo_cool at yahoo.co.id
Sun May 6 23:15:25 CEST 2018


> Any ideas how to identify potential unintentional loops?

That depends on your design. Is it intended that the 3 procedures can call
each other, directly or indirectly? If no, then things are a lot easier. You
can just put on the currently entered procedure name to a map shared by the
3 (or just make it global) and on start of each procedure, you check whether
the current procedure is in the map already or not. If yes, then the current
call stack has formed a recursion.



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/



More information about the fpc-pascal mailing list