Hi guys!
I always ignored division by zero until now, when I found out that Android apps made with free pascal crash hard when they reach a division by zero.
I have a game that works fine on Windows, but on Android sometimes crashes with a cryptic crash dump, that I think it is probably caused by a division by zero.
My question is, is there a way to detect divisions by zero in fpc, by way of exceptions or something?
I want to detect all divisions by error when running the game (on Windows for example, it might be easier), and then write code to handle them correctly, and thus, hopefully stopping the Android version from crashing.
So, is there a way to automatically detect a line of code that does a division by zero at run time?
I can't really just search in the code, mostly because the code base is huge (150 thousand lines) and the division symbol is easily confused with the comment symbol, so it is very hard to search
