diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-08-30 17:30:18 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-30 22:47:02 +0200 |
commit | 30a1a25daa3ce2a279e286384f8e0d12762dada7 (patch) | |
tree | e71251ab59c3e7469a8acec9179c57ec5b0be123 /Tests/LibWasm/test-wasm.cpp | |
parent | 2c7e2e351aa2c40daedfd8ddac3ef868ebac0f2c (diff) | |
download | serenity-30a1a25daa3ce2a279e286384f8e0d12762dada7.zip |
Tests/LibWasm: Handle all stream errors in parse_webassembly_module
Diffstat (limited to 'Tests/LibWasm/test-wasm.cpp')
-rw-r--r-- | Tests/LibWasm/test-wasm.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index 838790bdd3..2a8a44ecc5 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -104,6 +104,11 @@ TESTJS_GLOBAL_FUNCTION(parse_webassembly_module, parseWebAssemblyModule) } auto& array = static_cast<JS::Uint8Array&>(*object); InputMemoryStream stream { array.data() }; + ScopeGuard handle_stream_error { + [&] { + stream.handle_any_error(); + } + }; auto result = Wasm::Module::parse(stream); if (result.is_error()) { vm.throw_exception<JS::SyntaxError>(global_object, Wasm::parse_error_to_string(result.error())); |