summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/wasm-reduce.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 0332b4712..1d5164397 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -346,10 +346,14 @@ struct Reducer
void loadWorking() {
module = make_unique<Module>();
- Module wasm;
ModuleReader reader;
reader.read(working, *module);
- wasm.features = FeatureSet::All;
+ // 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;
+ }
builder = make_unique<Builder>(*module);
setModule(module.get());
}