summaryrefslogtreecommitdiff
path: root/scripts/fuzz_opt.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-07-14 15:07:42 -0700
committerGitHub <noreply@github.com>2021-07-14 15:07:42 -0700
commit3130409376dff61eb7b1bec01166ff72e927bad6 (patch)
tree6352343ee5f92422c1ebbc8769171a66cf47592e /scripts/fuzz_opt.py
parentb842715392a6e18cfae6bdabce670a1d618611fc (diff)
downloadbinaryen-3130409376dff61eb7b1bec01166ff72e927bad6.tar.gz
binaryen-3130409376dff61eb7b1bec01166ff72e927bad6.tar.bz2
binaryen-3130409376dff61eb7b1bec01166ff72e927bad6.zip
Fuzzer: Use NameTypes in RoundTrip (#3986)
This works around the issue with wasm gc types sometimes getting truncated (as the default names can be very long or even infinitely recursive). If the truncation leads to name collision, the wast is not valid.
Diffstat (limited to 'scripts/fuzz_opt.py')
-rwxr-xr-xscripts/fuzz_opt.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index eff4baeef..f4c260665 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -886,7 +886,11 @@ class RoundtripText(TestCaseHandler):
frequency = 0.05
def handle(self, wasm):
- run([in_bin('wasm-dis'), wasm, '-o', 'a.wast'])
+ # use name-types because in wasm GC we can end up truncating the default
+ # names which are very long, causing names to collide and the wast to be
+ # invalid
+ # FIXME: run name-types by default during load?
+ run([in_bin('wasm-opt'), wasm, '--name-types', '-S', '-o', 'a.wast'] + FEATURE_OPTS)
run([in_bin('wasm-opt'), 'a.wast'] + FEATURE_OPTS)