1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 07:44:59 +00:00

LibWasm: Port the parser to Core::Stream

This commit is contained in:
Tim Schumacher 2023-01-21 11:44:19 +01:00 committed by Ali Mohammad Pur
parent 409fb0fe79
commit 982ebbc304
6 changed files with 292 additions and 263 deletions

View file

@ -252,8 +252,8 @@ static Optional<Wasm::Module> parse(StringView filename)
return {};
}
InputMemoryStream stream { ReadonlyBytes { result.value()->data(), result.value()->size() } };
auto parse_result = Wasm::Module::parse(stream);
auto stream = Core::Stream::FixedMemoryStream::construct(ReadonlyBytes { result.value()->data(), result.value()->size() }).release_value_but_fixme_should_propagate_errors();
auto parse_result = Wasm::Module::parse(*stream);
if (parse_result.is_error()) {
warnln("Something went wrong, either the file is invalid, or there's a bug with LibWasm!");
warnln("The parse error was {}", Wasm::parse_error_to_deprecated_string(parse_result.error()));