diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-21 18:33:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 02:33:00 +0800 |
commit | 63b5b6d2b34c706692dee18e90877b7e71ee2e01 (patch) | |
tree | a7e6b183e007dd8de4f7ff6d5603273f8f908cf2 | |
parent | e675262d51103122720aded924f5571e12086fc9 (diff) | |
download | tracifyjs-63b5b6d2b34c706692dee18e90877b7e71ee2e01.tar.gz tracifyjs-63b5b6d2b34c706692dee18e90877b7e71ee2e01.zip |
suppress false positives in `ufuzz` (#4578)
-rw-r--r-- | test/sandbox.js | 4 | ||||
-rw-r--r-- | test/ufuzz/index.js | 3 | ||||
-rw-r--r-- | test/ufuzz/job.js | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/test/sandbox.js b/test/sandbox.js index bd4c7a8d..707a71e1 100644 --- a/test/sandbox.js +++ b/test/sandbox.js @@ -226,7 +226,7 @@ function run_code_exec(code, toplevel, timeout) { }); } try { - return execSync('"' + process.argv[0] + '" --max-old-space-size=4096', { + return execSync('"' + process.argv[0] + '" --max-old-space-size=2048', { encoding: "utf8", input: code, stdio: "pipe", @@ -234,7 +234,7 @@ function run_code_exec(code, toplevel, timeout) { }); } catch (ex) { var msg = ex.message.replace(/\r\n/g, "\n"); - if (/ETIMEDOUT/.test(msg)) return new Error("Script execution timed out."); + if (/ETIMEDOUT|FATAL ERROR:/.test(msg)) return new Error("Script execution timed out."); var end = msg.indexOf("\n\n-----===== UNCAUGHT EXCEPTION =====-----\n\n"); var details; if (end >= 0) { diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index 01863e1a..6dc2c63e 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -317,7 +317,6 @@ var VAR_NAMES = [ "NaN", "Infinity", "arguments", - "parseInt", "async", "await", ]; @@ -1848,7 +1847,7 @@ function patch_try_catch(orig, toplevel) { } var new_code = code.slice(0, index) + insert + code.slice(index) + tail_throw; var result = sandbox.run_code(new_code, toplevel); - if (typeof result != "object" || typeof result.name != "string" || typeof result.message != "string") { + if (!sandbox.is_error(result)) { if (!stack.filled && match[1]) stack.push({ code: code, index: index && index - 1, diff --git a/test/ufuzz/job.js b/test/ufuzz/job.js index 6edfba53..5cef23e9 100644 --- a/test/ufuzz/job.js +++ b/test/ufuzz/job.js @@ -2,7 +2,7 @@ var actions = require("./actions"); var child_process = require("child_process"); var args = [ - "--max-old-space-size=4096", + "--max-old-space-size=2048", "test/ufuzz", ]; var iterations; |