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, 7 insertions, 1 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 19afc2032..95e315e96 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -347,7 +347,13 @@ struct Reducer
void loadWorking() {
module = make_unique<Module>();
ModuleReader reader;
- reader.read(working, *module);
+ try {
+ reader.read(working, *module);
+ } catch (ParseException& p) {
+ p.dump(std::cerr);
+ std::cerr << '\n';
+ Fatal() << "error in parsing working wasm binary";
+ }
// 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).