Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions src/tools/fuzzing/fuzzing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ void TranslateToFuzzReader::pickPasses(OptimizationOptions& options) {

// Prune things that error in JS if we call them (like SIMD), some of the
// time. This alters the wasm/JS boundary quite a lot, so testing both forms
// is useful.
if (oneIn(2)) {
// is useful. Note that we do not do this if there is an imported module,
// because in that case legalization could alter the contract between the two
// (that is, if the first module has an i64 param, we must call it like that,
// and not as two i32s which we'd get after legalization).
if (!importedModule && oneIn(2)) {
options.passes.push_back("legalize-and-prune-js-interface");
}

Expand Down
6 changes: 3 additions & 3 deletions src/tools/wasm-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ For more on how to optimize effectively, see
if (translateToFuzz) {
TranslateToFuzzReader reader(
wasm, options.extra["infile"], options.passOptions.closedWorld);
if (fuzzPasses) {
reader.pickPasses(options);
}
reader.setAllowMemory(fuzzMemory);
reader.setAllowOOB(fuzzOOB);
reader.setPreserveImportsAndExports(fuzzPreserveImportsAndExports);
if (!fuzzImport.empty()) {
reader.setImportedModule(fuzzImport);
}
if (fuzzPasses) {
reader.pickPasses(options);
}
reader.build();
if (options.passOptions.validate) {
if (!WasmValidator().validate(wasm, options.passOptions)) {
Expand Down
Loading