summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm-shell.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wasm-shell.cpp b/src/wasm-shell.cpp
index 1ad0a19ad..4d2d3b560 100644
--- a/src/wasm-shell.cpp
+++ b/src/wasm-shell.cpp
@@ -154,11 +154,14 @@ int main(int argc, char **argv) {
Expression* argument = builder.parseExpression(*invoke[2]);
arguments.push_back(argument->dyn_cast<Const>()->value);
}
+ bool trapped = false;
if (setjmp(interface->trapState) == 0) {
instance->callFunction(name, arguments);
} else {
- std::cout << "TRAPPED\n";
+ trapped = true;
}
+ if (id == ASSERT_RETURN) assert(!trapped);
+ if (id == ASSERT_TRAP) assert(trapped);
i++;
}
}