mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
21 lines
582 B
C++
21 lines
582 B
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibCore/MemoryStream.h>
|
|
#include <LibWasm/Types.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
ReadonlyBytes bytes { data, size };
|
|
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;
|
|
}
|