diff --git a/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp b/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp --- a/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp +++ b/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp @@ -26,6 +26,18 @@ namespace __lsan { +namespace { + +// Fuchsia does not need a threadslist. This class only exists to pass a dummy +// threadslist to pass to the StopTheWorldCallback since SuspendedThreadsList +// has a protected destructor. +class DummySuspendedThreadsListFuchsia final : public SuspendedThreadsList { + public: + ~DummySuspendedThreadsListFuchsia(){} +}; + +} + void InitializePlatformSpecificModules() {} LoadedModule *GetLinker() { return nullptr; } @@ -147,7 +159,8 @@ ¶ms->argument->frontier); } - params->callback({}, params->argument); + DummySuspendedThreadsListFuchsia threadlist; + params->callback(threadlist, params->argument); }, ¶ms); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp @@ -20,6 +20,18 @@ namespace __sanitizer { +namespace { + +// Fuchsia does not need a threadslist. This class only exists to pass a dummy +// threadslist to pass to the StopTheWorldCallback since SuspendedThreadsList +// has a protected destructor. +class DummySuspendedThreadsListFuchsia final : public SuspendedThreadsList { + public: + ~DummySuspendedThreadsListFuchsia(){} +}; + +} + // The Fuchsia implementation stops the world but doesn't offer a real // SuspendedThreadsList argument. This is enough for ASan's use case, // and LSan does not use this API on Fuchsia. @@ -32,7 +44,8 @@ nullptr, nullptr, nullptr, nullptr, [](zx_status_t, void *data) { auto params = reinterpret_cast(data); - params->callback({}, params->argument); + DummySuspendedThreadsListFuchsia threadlist; + params->callback(threadlist, params->argument); }, ¶ms); }