suppress false positives in ufuzz (#5327)

This commit is contained in:
Alex Lam S.L
2022-02-01 04:17:47 +00:00
committed by GitHub
parent d7eb80b050
commit 93105f1a6d

View File

@@ -2139,7 +2139,7 @@ function log_suspects(minify_options, component) {
var defs = default_options[component]; var defs = default_options[component];
var toplevel = sandbox.has_toplevel(minify_options); var toplevel = sandbox.has_toplevel(minify_options);
var suspects = Object.keys(defs).filter(function(name) { var suspects = Object.keys(defs).filter(function(name) {
var flip = name == "keep_fargs"; var flip = component == "compress" && name == "keep_fargs";
if (flip !== (name in options ? options : defs)[name]) { if (flip !== (name in options ? options : defs)[name]) {
var m = JSON.parse(JSON.stringify(minify_options)); var m = JSON.parse(JSON.stringify(minify_options));
var o = JSON.parse(JSON.stringify(options)); var o = JSON.parse(JSON.stringify(options));
@@ -2490,14 +2490,20 @@ for (var round = 1; round <= num_iterations; round++) {
// ignore runtime platform bugs // ignore runtime platform bugs
if (!ok && uglify_result.message == "Script execution aborted.") ok = true; if (!ok && uglify_result.message == "Script execution aborted.") ok = true;
// handle difference caused by time-outs // handle difference caused by time-outs
if (!ok && errored && is_error_timeout(original_result)) { if (!ok) {
if (is_error_timeout(uglify_result)) { if (errored && is_error_timeout(original_result)) {
// ignore difference in error message if (is_error_timeout(uglify_result)) {
ok = true; // ignore difference in error message
} else { ok = true;
} else {
// ignore spurious time-outs
if (!orig_result[toplevel ? 3 : 2]) orig_result[toplevel ? 3 : 2] = run_code(original_code, toplevel, 10000);
ok = sandbox.same_stdout(orig_result[toplevel ? 3 : 2], uglify_result);
}
} else if (is_error_timeout(uglify_result)) {
// ignore spurious time-outs // ignore spurious time-outs
if (!orig_result[toplevel ? 3 : 2]) orig_result[toplevel ? 3 : 2] = run_code(original_code, toplevel, 10000); var waited_result = run_code(uglify_code, toplevel, 10000);
ok = sandbox.same_stdout(orig_result[toplevel ? 3 : 2], uglify_result); ok = sandbox.same_stdout(original_result, waited_result);
} }
} }
// ignore declaration order of global variables // ignore declaration order of global variables