summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-06-18 12:46:55 -0700
committerGitHub <noreply@github.com>2020-06-18 12:46:55 -0700
commitdd4c07c77ee11a6f89651990ad66fd96776b58db (patch)
treef0b167aaf1b70253e98f5034fba8bbb772389752
parentf6eb790eec107064798b9e54552f1ef5966f6359 (diff)
downloadbinaryen-dd4c07c77ee11a6f89651990ad66fd96776b58db.tar.gz
binaryen-dd4c07c77ee11a6f89651990ad66fd96776b58db.tar.bz2
binaryen-dd4c07c77ee11a6f89651990ad66fd96776b58db.zip
Fuzzer: Ignore V8 warnings on removed flags when comparing VMs (#2916)
fixes #2915
-rwxr-xr-xscripts/fuzz_opt.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 9e644598e..76d97bd2e 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -223,9 +223,21 @@ def fix_output(out):
out = re.sub(r'f64\.const (-?[nanN:abcdefxIity\d+-.]+)', fix_double, out)
# mark traps from wasm-opt as exceptions, even though they didn't run in a vm
out = out.replace('[trap ', 'exception: [trap ')
- # exceptions may differ when optimizing, but an exception should occur. so ignore their types
- # also js engines print them out slightly differently
- return '\n'.join(map(lambda x: ' *exception*' if 'exception' in x else x, out.splitlines()))
+ lines = out.splitlines()
+ for i in range(len(lines)):
+ line = lines[i]
+ if 'Warning: unknown flag' in line or 'Try --help for options' in line:
+ # ignore some VM warnings that don't matter, like if a newer V8 has
+ # removed a flag that is no longer needed. but print the line so the
+ # developer can see it.
+ print(line)
+ lines[i] = None
+ elif 'exception' in line:
+ # exceptions may differ when optimizing, but an exception should
+ # occur, so ignore their types (also js engines print them out
+ # slightly differently)
+ lines[i] = ' *exception*'
+ return '\n'.join([line for line in lines if line is not None])
def fix_spec_output(out):