summaryrefslogtreecommitdiff
path: root/src/binaryen-shell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/binaryen-shell.cpp')
-rw-r--r--src/binaryen-shell.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp
index 8c0390d15..360b576c8 100644
--- a/src/binaryen-shell.cpp
+++ b/src/binaryen-shell.cpp
@@ -113,10 +113,7 @@ static void run_asserts(size_t* i, bool* checked, Module* wasm,
std::unique_ptr<SExpressionWasmBuilder> builder;
try {
builder = std::unique_ptr<SExpressionWasmBuilder>(
- new SExpressionWasmBuilder(wasm, *curr[1], [&]() {
- invalid = true;
- throw ParseException();
- })
+ new SExpressionWasmBuilder(wasm, *curr[1])
);
} catch (const ParseException&) {
invalid = true;
@@ -214,8 +211,13 @@ int main(int argc, const char* argv[]) {
if (id == MODULE) {
if (options.debug) std::cerr << "parsing s-expressions to wasm...\n";
Module wasm;
- std::unique_ptr<SExpressionWasmBuilder> builder(
- new SExpressionWasmBuilder(wasm, *root[i], [&]() { abort(); }));
+ std::unique_ptr<SExpressionWasmBuilder> builder;
+ try {
+ builder = make_unique<SExpressionWasmBuilder>(wasm, *root[i]);
+ } catch (ParseException& p) {
+ p.dump(std::cerr);
+ abort();
+ }
i++;
assert(WasmValidator().validate(wasm));