diff options
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r-- | src/tools/wasm-reduce.cpp | 8 |
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()); } |