diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-04 19:37:41 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-04 19:37:41 -0700 |
| commit | 8d95dc74a767348e758f3299a2be8ba28d430f30 (patch) | |
| tree | 824679cf5f7d55827b6ff556fa1f00a680d41673 | |
| parent | 976fb55c45b438a1aebb2366c209682961fbcdd3 (diff) | |
Added timeout by instruction count.
| -rw-r--r-- | lib/timeout.nom | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/timeout.nom b/lib/timeout.nom new file mode 100644 index 0000000..3ff821f --- /dev/null +++ b/lib/timeout.nom @@ -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)) |
