summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/SimpleHashTest.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-10-02 23:34:06 +0000
committerKostya Serebryany <kcc@google.com>2015-10-02 23:34:06 +0000
commit20bb5e71b25ba3f2debef4035dc8b5def7d1763c (patch)
treea5cd689d494488459339592e88766820a5d1085f /llvm/lib/Fuzzer/test/SimpleHashTest.cpp
parent7dfaaf3891993fb8bbce1c509d263064c7301a19 (diff)
downloadbcm5719-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/test/SimpleHashTest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/SimpleHashTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/test/SimpleHashTest.cpp b/llvm/lib/Fuzzer/test/SimpleHashTest.cpp
index a541d6813b5..5bab3fa7f64 100644
--- a/llvm/lib/Fuzzer/test/SimpleHashTest.cpp
+++ b/llvm/lib/Fuzzer/test/SimpleHashTest.cpp
@@ -22,15 +22,16 @@ static uint32_t simple_hash(const uint8_t *Data, size_t Size) {
return Hash;
}
-extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 14)
- return;
+ return 0;
uint32_t Hash = simple_hash(&Data[0], Size - 4);
uint32_t Want = reinterpret_cast<const uint32_t *>(&Data[Size - 4])[0];
if (Hash != Want)
- return;
+ return 0;
fprintf(stderr, "BINGO; simple_hash defeated: %x == %x\n", (unsigned int)Hash,
(unsigned int)Want);
exit(1);
+ return 0;
}
OpenPOWER on IntegriCloud