From 42a5d7b68a5106117e2107fab8bee1b1749ad8dd Mon Sep 17 00:00:00 2001 From: FuzzTest Team Date: Fri, 24 Jul 2026 07:50:14 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 953364704 --- fuzztest/internal/runtime.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fuzztest/internal/runtime.cc b/fuzztest/internal/runtime.cc index f03dbaf18..00e2026cd 100644 --- a/fuzztest/internal/runtime.cc +++ b/fuzztest/internal/runtime.cc @@ -383,7 +383,18 @@ void Runtime::PrintReport(RawSink out) const { absl::Format(out, "%s", GetSeparator()); } -#ifndef FUZZTEST_USE_CENTIPEDE +#if defined(FUZZTEST_USE_CENTIPEDE) || \ + ((defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__wasm32__)) && \ + !defined(__EMSCRIPTEN_PTHREADS__)) + +// Centipede runner has its own watchdog. Single-threaded WebAssembly (without +// __EMSCRIPTEN_PTHREADS__) does not support threads. +class Runtime::Watchdog { + public: + explicit Watchdog(Runtime&) {} +}; + +#else class Runtime::Watchdog { public: @@ -419,15 +430,7 @@ class Runtime::Watchdog { Runtime& runtime_; }; -#else // FUZZTEST_USE_CENTIPEDE - -// Centipede runner has its own watchdog. -class Runtime::Watchdog { - public: - explicit Watchdog(Runtime&) {} -}; - -#endif // FUZZTEST_USE_CENTIPEDE +#endif // FUZZTEST_USE_CENTIPEDE || __EMSCRIPTEN__ || __wasm__ || __wasm32__ Runtime::Watchdog Runtime::CreateWatchdog() { return Watchdog{*this}; }