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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,7 +2490,8 @@ 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 (errored && is_error_timeout(original_result)) {
if (is_error_timeout(uglify_result)) { if (is_error_timeout(uglify_result)) {
// ignore difference in error message // ignore difference in error message
ok = true; ok = true;
@ -2499,6 +2500,11 @@ for (var round = 1; round <= num_iterations; round++) {
if (!orig_result[toplevel ? 3 : 2]) orig_result[toplevel ? 3 : 2] = run_code(original_code, toplevel, 10000); 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); ok = sandbox.same_stdout(orig_result[toplevel ? 3 : 2], uglify_result);
} }
} else if (is_error_timeout(uglify_result)) {
// ignore spurious time-outs
var waited_result = run_code(uglify_code, toplevel, 10000);
ok = sandbox.same_stdout(original_result, waited_result);
}
} }
// ignore declaration order of global variables // ignore declaration order of global variables
if (!ok && !toplevel && uglify_result.name != "SyntaxError" && original_result.name != "SyntaxError") { if (!ok && !toplevel && uglify_result.name != "SyntaxError" && original_result.name != "SyntaxError") {