[libFuzzer] Fix -Wunused-variable when building with NDEBUG (#188301) The variable `FuzzerInitIsRunning` is only used within `assert()`. Follow up to #178342. GitOrigin-RevId: 9fd8bc0f0eedd3d6ca2c71f90de768a7759ab44c
diff --git a/FuzzerInterceptors.cpp b/FuzzerInterceptors.cpp index d5b0a42..3960dc0 100644 --- a/FuzzerInterceptors.cpp +++ b/FuzzerInterceptors.cpp
@@ -48,7 +48,9 @@ } static int FuzzerInited = 0; +#ifndef NDEBUG static bool FuzzerInitIsRunning; +#endif static void fuzzerInit(); @@ -226,7 +228,9 @@ assert(!FuzzerInitIsRunning); if (FuzzerInited) return; +#ifndef NDEBUG FuzzerInitIsRunning = true; +#endif REAL(bcmp) = reinterpret_cast<memcmp_type>( getFuncAddr("bcmp", reinterpret_cast<uintptr_t>(&bcmp))); @@ -247,7 +251,9 @@ REAL(memmem) = reinterpret_cast<memmem_type>( getFuncAddr("memmem", reinterpret_cast<uintptr_t>(&memmem))); +#ifndef NDEBUG FuzzerInitIsRunning = false; +#endif FuzzerInited = 1; }