Make loops time out

Previous setup did not properly cause loops to time out due to returning false, msg rather than using error().
master
octacian 2017-01-30 19:57:46 -08:00
parent 9169209333
commit 7fad5d4762
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ function digicompute.run_code(code, env)
-- Use instruction counter to stop execution
-- after 10000 events
debug.sethook(function()
return false, "Code timed out!"
error("Code timed out!", 2)
end, "", 10000)
local ok, ret = pcall(f)
debug.sethook() -- Clear hook