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:
parent
409fb0fe79
commit
982ebbc304
6 changed files with 292 additions and 263 deletions
|
@ -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()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue