diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index cfa160dde2c..a8a108cd186 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -22,7 +22,9 @@ static bool read_stdin(std::vector& 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(); } diff --git a/src/test/fuzz/fuzz.h b/src/test/fuzz/fuzz.h index 573bd572dbc..3be202b16e8 100644 --- a/src/test/fuzz/fuzz.h +++ b/src/test/fuzz/fuzz.h @@ -8,7 +8,7 @@ #include #include - +void initialize(); void test_one_input(const std::vector& buffer); #endif // BITCOIN_TEST_FUZZ_FUZZ_H