mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +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
|
@ -4,8 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/Stream.h>
|
||||
#include <LibCore/MemoryStream.h>
|
||||
#include <LibWasm/Types.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
@ -13,8 +12,10 @@
|
|||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
ReadonlyBytes bytes { data, size };
|
||||
InputMemoryStream stream { bytes };
|
||||
[[maybe_unused]] auto result = Wasm::Module::parse(stream);
|
||||
stream.handle_any_error();
|
||||
auto stream_or_error = Core::Stream::FixedMemoryStream::construct(bytes);
|
||||
if (stream_or_error.is_error())
|
||||
return 0;
|
||||
auto stream = stream_or_error.release_value();
|
||||
[[maybe_unused]] auto result = Wasm::Module::parse(*stream);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue