From e09c72711ef2e7868d582f3e769f4d21235c19c6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 19 Apr 2023 10:37:45 -0700 Subject: [PATCH] Fuzzer: Run --dce when GC is enabled (#5677) DCE at the end avoids issues with non-nullable local operations in unreachable code, which is still being discussed. This PR avoids fuzzer errors for now, but we should revert it when we have a proper fix. See * #5599 * #5665 * https://github.com/WebAssembly/function-references/issues/98 --- scripts/fuzz_opt.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 25d06c148bd..03334ffa7a0 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -181,6 +181,15 @@ def randomize_fuzz_settings(): FUZZ_OPTS += ['--legalize-js-interface'] else: LEGALIZE = False + + # if GC is enabled then run --dce at the very end, to ensure that our + # binaries validate in other VMs, due to how non-nullable local validation + # and unreachable code interact. see + # https://github.com/WebAssembly/binaryen/pull/5665 + # https://github.com/WebAssembly/binaryen/issues/5599 + if '--disable-gc' not in FEATURE_OPTS: + FUZZ_OPTS += ['--dce'] + print('randomized settings (NaNs, OOB, legalize):', NANS, OOB, LEGALIZE)