Added timeout by instruction count.

This commit is contained in:
Bruce Hill 2017-10-04 19:37:41 -07:00
parent 976fb55c45
commit 8d95dc74a7

6
lib/timeout.nom Normal file
View File

@ -0,0 +1,6 @@
require "lib/core.nom"
rule [cap at %num instructions] =:
lua code ".."
|print("capped at", \(%num))
|local f = function() error("timeout") end
|debug.sethook(f, "", \(%num))