diff options
author | alon@honor <none@none> | 2010-09-21 20:38:37 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-21 20:38:37 -0700 |
commit | 427206373413805fef3c56915fa6e1ac9dd93627 (patch) | |
tree | 1c19679707ba330607b19806c60b099cd412fdbc /src/jsifier.js | |
parent | ab582256db454b3ccab074058941311845746f8b (diff) |
fix some relooper bugs, and EXECUTION_TIMEOUT setting for debugging such problems
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index c4235b3f..86c9270e 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -222,7 +222,10 @@ function JSify(data) { function getLabelLines(label, indent) { var ret = ''; if (LABEL_DEBUG) { - ret += indent + " print(INDENT + '" + func.ident + ":" + label.ident + "');\n"; + ret += indent + "print(INDENT + '" + func.ident + ":" + label.ident + "');\n"; + } + if (EXECUTION_TIMEOUT > 0) { + ret += indent + 'if (Date.now() - START_TIME >= ' + (EXECUTION_TIMEOUT*1000) + ') throw "Timed out!" + (new Error().stack);\n'; } // for special labels we care about (for phi), mark that we visited them if (func.remarkableLabels.indexOf(label.ident) >= 0) { |