|
debug.sethook will let you count the number of line executions.Of course, perfect infinite loop detection is, in fact, impossible (http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing it (probably by a C hook).From: Travis BakerSent: Saturday, October 10, 2009 P5:33Newsgroups: gmane.comp.lang.lua.generalSubject: Infinite Loop DetectionI've seen infinite loop detection used in applications before. (Garry's Mod)
Does anyone know how to go about creating something like this. It doesn't have to necessarily check for an infinite as much as hit a threshold limit for how many time a loop can repeat itself.
Any Ideas? Thanks