ladybird/Meta/Fuzzers/FuzzWasmParser.cpp

20 lines
467 B
C++
Raw Permalink Normal View History

2021-05-03 20:55:48 -03:00
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
2023-01-25 16:19:05 -03:00
#include <AK/MemoryStream.h>
2021-05-03 20:55:48 -03:00
#include <LibWasm/Types.h>
#include <stddef.h>
#include <stdint.h>
2022-04-01 14:58:27 -03:00
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
2021-05-03 20:55:48 -03:00
{
AK::set_debug_enabled(false);
2021-05-03 20:55:48 -03:00
ReadonlyBytes bytes { data, size };
FixedMemoryStream stream { bytes };
[[maybe_unused]] auto result = Wasm::Module::parse(stream);
2021-05-03 20:55:48 -03:00
return 0;
}