[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Aborting LUA run
- From: Nick Gammon <nick@...>
- Date: Thu, 12 Oct 2006 15:04:35 +1000
On 12/10/2006, at 2:14 PM, jason bright wrote:
I haven't tried, but first thing that comes to mind is to inject an
error
when inside the hook function, but thats an ugly solution.
That's what I did, it never occurred to me that is is ugly.
runaway_instruction_limit = 100000 -- how many instructions
-- this is called if 'runaway_instruction_limit' instructions are done
function hook ()
error ("Runaway instruction limit reached")
end -- hook
-- put limit on runaway loops
debug.sethook (hook, "", runaway_instruction_limit)
- Nick