From 30a1a25daa3ce2a279e286384f8e0d12762dada7 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 30 Aug 2021 17:30:18 +0430 Subject: [PATCH] Tests/LibWasm: Handle all stream errors in parse_webassembly_module --- Tests/LibWasm/test-wasm.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(*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(global_object, Wasm::parse_error_to_string(result.error()));