diff options
Diffstat (limited to 'src/test/fuzz/fuzz.cpp')
-rw-r--r-- | src/test/fuzz/fuzz.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index cfa160dde2..da4e623e98 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -4,11 +4,9 @@ #include <test/fuzz/fuzz.h> +#include <cstdint> #include <unistd.h> - -#include <pubkey.h> -#include <util/memory.h> - +#include <vector> static bool read_stdin(std::vector<uint8_t>& data) { @@ -22,9 +20,9 @@ static bool read_stdin(std::vector<uint8_t>& data) return length == 0; } -static void initialize() +// Default initialization: Override using a non-weak initialize(). +__attribute__((weak)) void initialize() { - const static auto verify_handle = MakeUnique<ECCVerifyHandle>(); } // This function is used by libFuzzer @@ -42,13 +40,9 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) return 0; } -// Disabled under WIN32 due to clash with Cygwin's WinMain. -#ifndef WIN32 // Declare main(...) "weak" to allow for libFuzzer linking. libFuzzer provides // the main(...) function. -__attribute__((weak)) -#endif -int main(int argc, char **argv) +__attribute__((weak)) int main(int argc, char** argv) { initialize(); #ifdef __AFL_INIT |