speed up false positive detection in ufuzz (#3996)

This commit is contained in:
Alex Lam S.L
2020-06-13 20:42:42 +01:00
committed by GitHub
parent 88850a6e05
commit 9aed0e3a73

View File

@@ -1229,7 +1229,7 @@ function patch_try_catch(orig, toplevel) {
var new_code = code.slice(0, index) + insert + code.slice(index); var new_code = code.slice(0, index) + insert + code.slice(index);
var result = sandbox.run_code(new_code, toplevel); var result = sandbox.run_code(new_code, toplevel);
if (typeof result != "object" || typeof result.name != "string" || typeof result.message != "string") { 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, code: code,
index: index, index: index,
offset: offset, 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); return orig.slice(0, index) + 'throw new Error("skipping infinite recursion");' + orig.slice(index);
} }
} }
stack.filled = true;
} }
} }