diff options
author | Kostya Serebryany <kcc@google.com> | 2015-10-02 23:34:06 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-10-02 23:34:06 +0000 |
commit | 20bb5e71b25ba3f2debef4035dc8b5def7d1763c (patch) | |
tree | a5cd689d494488459339592e88766820a5d1085f /llvm/lib/Fuzzer/FuzzerLoop.cpp | |
parent | 7dfaaf3891993fb8bbce1c509d263064c7301a19 (diff) | |
download | bcm5719-llvm-20bb5e71b25ba3f2debef4035dc8b5def7d1763c.tar.gz bcm5719-llvm-20bb5e71b25ba3f2debef4035dc8b5def7d1763c.zip |
[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. The actual return value is not *yet* used (and expected to be 0). This change is API breaking, so the fuzzers will need to be updated.
llvm-svn: 249214
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index 62a47bf0581..bfeed1ab21e 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -194,12 +194,14 @@ Unit Fuzzer::SubstituteTokens(const Unit &U) const { } void Fuzzer::ExecuteCallback(const Unit &U) { + int Res = 0; if (Options.Tokens.empty()) { - USF.TargetFunction(U.data(), U.size()); + Res = USF.TargetFunction(U.data(), U.size()); } else { auto T = SubstituteTokens(U); - USF.TargetFunction(T.data(), T.size()); + Res = USF.TargetFunction(T.data(), T.size()); } + assert(Res == 0); } size_t Fuzzer::RunOneMaximizeTotalCoverage(const Unit &U) { |