ladybird/Meta/Fuzzers/FuzzRegexECMA262.cpp

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

2020-11-28 14:48:01 -03:00
/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
2020-11-28 14:48:01 -03:00
*/
#include <AK/StringView.h>
#include <AK/Utf16String.h>
#include <LibRegex/ECMAScriptRegex.h>
2020-11-28 14:48:01 -03:00
#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)
2020-11-28 14:48:01 -03:00
{
AK::set_debug_enabled(false);
auto pattern = Utf16String::from_utf8_with_replacement_character(StringView(static_cast<unsigned char const*>(data), size));
[[maybe_unused]] auto re = regex::ECMAScriptRegex::compile(pattern.utf16_view(), {});
2020-11-28 14:48:01 -03:00
return 0;
}