Make loops time out
Previous setup did not properly cause loops to time out due to returning false, msg rather than using error().master
parent
9169209333
commit
7fad5d4762
2
env.lua
2
env.lua
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue