Skip to content

Commit

Permalink
clarify the expected behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Feb 7, 2025
1 parent f93e130 commit a333277
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tools/execution-results.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ struct LoggingExternalInterface : public ShellExternalInterface {
std::cout << "]\n";
return {};
} else if (import->base == "throw") {
// Throw something, depending on the value of the argument. 0 means we
// should throw a JS exception, and any other value means we should
// throw a wasm exception (with that value as the payload).
if (arguments[0].geti32() == 0) {
// Throw in a way similar to JS.
throwEmptyException();
} else {
// Throw the argument in the imported JS tag.
auto payload = std::make_shared<ExnData>(fuzzTag, arguments);
throwException(WasmException{Literal(payload)});
}
Expand Down

0 comments on commit a333277

Please sign in to comment.