diff --git a/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp b/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp index cb8d08ad9f..96caf75624 100644 --- a/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp +++ b/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp @@ -9,16 +9,21 @@ #include namespace { + struct Globals { Globals(); } globals; -Globals::Globals() { Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity); } + +Globals::Globals() +{ + Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity); + MUST(Web::Bindings::initialize_main_thread_vm()); +} + } extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { - MUST(Web::Bindings::initialize_main_thread_vm()); - // FIXME: There's got to be a better way to do this "correctly" auto& vm = Web::Bindings::main_thread_vm(); (void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingContext(*vm.current_realm()), { data, size });