Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions scripts/fuzz_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2157,13 +2157,19 @@ def do_handle_pair(self, input, before_wasm, after_wasm, opts):

# Modify the initial wat to get the pre-optimizations wasm.
pre_wasm = abspath('pre.wasm')
run([in_bin('wasm-opt'), input] + FEATURE_OPTS + [
gen_args = [
input,
'-ttf',
'--fuzz-preserve-imports-exports',
'--initial-fuzz=' + wat_file,
'-o', pre_wasm,
'-g',
])
]
# We do not copy all of GEN_ARGS, as we don't need e.g. legalization.
if not NANS:
# TODO: do we also need this in each reduction step?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What reduction steps is this referring to? The reductions in wasm-reduce?

gen_args += ['--denan']
run([in_bin('wasm-opt')] + gen_args + FEATURE_OPTS)

# We successfully generated pre_wasm; stash it for possible reduction
# purposes later.
Expand Down Expand Up @@ -2206,8 +2212,9 @@ def do_handle_pair(self, input, before_wasm, after_wasm, opts):
post_vm = random.choice(vms)
post = self.do_run(post_vm, js_file, post_wasm)

# Compare
compare(pre, post, 'PreserveImportsExportsJS')
# Compare, if we can.
if pre_vm.can_compare_to_other(post_vm):
compare(pre, post, 'PreserveImportsExportsJS')

def do_run(self, vm, js, wasm):
out = vm.run_js(js, wasm, checked=False)
Expand Down
Loading