Skip to content
Merged
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: 7 additions & 8 deletions src/tools/wasm-merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,6 @@ Input source maps can be specified by adding an -ism option right after the modu
}
}

// If we didn't validate after each merged module, validate once at the very
// end. This won't catch problems at the earliest point, but is still useful.
if (!PassRunner::getPassDebug() && options.passOptions.validate &&
!WasmValidator().validate(merged)) {
std::cout << merged << '\n';
Fatal() << "error in validating final merged";
}

// Fuse imports and exports now that everything is all together in the merged
// module.
fuseImportsAndExports(options.passOptions);
Expand All @@ -808,6 +800,13 @@ Input source maps can be specified by adding an -ism option right after the modu
passRunner.run();
}

// Without pass-debug mode, validate once at the very end.
if (!PassRunner::getPassDebug() && options.passOptions.validate &&
!WasmValidator().validate(merged)) {
std::cout << merged << '\n';
Fatal() << "error in validating final merged";
}

// Output.
if (options.extra.count("output") > 0) {
ModuleWriter writer(options.passOptions);
Expand Down
Loading