diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-10-23 21:46:53 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-10-24 08:06:38 +0000 |
commit | db4bd32cc31789fc017f5db0b86a69ee43e41575 (patch) | |
tree | b97eeea39cbba000407c8323023d0d92b7ecd53a /src/test/fuzz/fuzz.cpp | |
parent | c5ac7af7793a70d73d6bab09a7bc29dc4ddc7ea2 (diff) |
tests: Skip unnecessary fuzzer initialisation. Hold ECCVerifyHandle only when needed.
Diffstat (limited to 'src/test/fuzz/fuzz.cpp')
-rw-r--r-- | src/test/fuzz/fuzz.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index a8a108cd18..44256ce867 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) { @@ -23,10 +21,8 @@ static bool read_stdin(std::vector<uint8_t>& data) } // Default initialization: Override using a non-weak initialize(). -__attribute__((weak)) -void initialize() +__attribute__((weak)) void initialize() { - const static auto verify_handle = MakeUnique<ECCVerifyHandle>(); } // This function is used by libFuzzer @@ -50,7 +46,8 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) // the main(...) function. __attribute__((weak)) #endif -int main(int argc, char **argv) +int +main(int argc, char** argv) { initialize(); #ifdef __AFL_INIT |