From 8d95dc74a767348e758f3299a2be8ba28d430f30 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 4 Oct 2017 19:37:41 -0700 Subject: [PATCH] Added timeout by instruction count. --- lib/timeout.nom | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/timeout.nom 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))