diff options
author | Alon Zakai <azakai@google.com> | 2020-06-02 12:57:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-02 12:57:04 -0700 |
commit | cb6b1a1f8c17341ca2e8c0f552b24b455f7e2c3b (patch) | |
tree | eecb60de732a5c82fd6c8ff2f62e9feeb35ae6f2 /scripts | |
parent | 5c0b857fcc2fce78afc2f222f7d716be8c1949b2 (diff) | |
download | binaryen-cb6b1a1f8c17341ca2e8c0f552b24b455f7e2c3b.tar.gz binaryen-cb6b1a1f8c17341ca2e8c0f552b24b455f7e2c3b.tar.bz2 binaryen-cb6b1a1f8c17341ca2e8c0f552b24b455f7e2c3b.zip |
When fuzzing asyncify, avoid optimizations with nans (#2881)
We already avoid that in CompareVMs but Asyncify has the
same issue, as it also can optimize in binaryen but run in
another VM (with different nondeterministic NaN behavior).
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/fuzz_opt.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 8f9cbcb26..ac6ba977a 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -539,10 +539,14 @@ class Asyncify(TestCaseHandler): def do_asyncify(wasm): cmd = [in_bin('wasm-opt'), wasm, '--asyncify', '-o', 'async.t.wasm'] - if random.random() < 0.5: - cmd += ['--optimize-level=%d' % random.randint(1, 3)] - if random.random() < 0.5: - cmd += ['--shrink-level=%d' % random.randint(1, 2)] + # if we allow NaNs, running binaryen optimizations and then + # executing in d8 may lead to different results due to NaN + # nondeterminism between VMs. + if not NANS: + if random.random() < 0.5: + cmd += ['--optimize-level=%d' % random.randint(1, 3)] + if random.random() < 0.5: + cmd += ['--shrink-level=%d' % random.randint(1, 2)] cmd += FEATURE_OPTS run(cmd) out = run_d8('async.t.wasm') |