summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index c276296ad..8d9858b78 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -362,6 +362,9 @@ struct Reducer
void loadWorking() {
module = std::make_unique<Module>();
+
+ toolOptions.applyOptionsBeforeParse(*module);
+
ModuleReader reader;
try {
reader.read(working, *module);
@@ -371,15 +374,14 @@ struct Reducer
Fatal() << "error in parsing working wasm binary";
}
+ toolOptions.applyOptionsAfterParse(*module);
+
// If there is no features section, assume we may need them all (without
// this, a module with no features section but that uses e.g. atomics and
// bulk memory would not work).
if (!module->hasFeaturesSection) {
module->features = FeatureSet::All;
}
- // Apply features the user passed on the commandline.
- toolOptions.applyFeatures(*module);
-
builder = std::make_unique<Builder>(*module);
setModule(module.get());
}