diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-06-13 20:42:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 03:42:42 +0800 |
commit | 9aed0e3a734f4fd615ed539d8159e53be89af7e2 (patch) | |
tree | 93bc8dd082b2fe6a6b93e1b94732c5b30cff0164 /test/ufuzz | |
parent | 88850a6e05b25a4ffa66e729cca56bd15850a756 (diff) | |
download | tracifyjs-9aed0e3a734f4fd615ed539d8159e53be89af7e2.tar.gz tracifyjs-9aed0e3a734f4fd615ed539d8159e53be89af7e2.zip |
speed up false positive detection in `ufuzz` (#3996)
Diffstat (limited to 'test/ufuzz')
-rw-r--r-- | test/ufuzz/index.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index 1a8eaff5..7fe35308 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -1229,7 +1229,7 @@ function patch_try_catch(orig, toplevel) { var new_code = code.slice(0, index) + insert + code.slice(index); var result = sandbox.run_code(new_code, toplevel); if (typeof result != "object" || typeof result.name != "string" || typeof result.message != "string") { - if (match[1]) stack.push({ + if (!stack.filled && match[1]) stack.push({ code: code, index: index, offset: offset, @@ -1245,6 +1245,7 @@ function patch_try_catch(orig, toplevel) { return orig.slice(0, index) + 'throw new Error("skipping infinite recursion");' + orig.slice(index); } } + stack.filled = true; } } |