OSDN Git Service

[libFuzzer] add a dummy LLVMFuzzerMutate to afl/afl_driver.cpp (https://github.com...
authorKostya Serebryany <kcc@google.com>
Wed, 15 Mar 2017 23:54:40 +0000 (23:54 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 15 Mar 2017 23:54:40 +0000 (23:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297919 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/afl/afl_driver.cpp

index fc95895..b3a54e5 100644 (file)
@@ -238,6 +238,13 @@ static void maybe_duplicate_stderr() {
   }
 }
 
+// Define LLVMFuzzerMutate to avoid link failures for targets that use it
+// with libFuzzer's LLVMFuzzerCustomMutator.
+extern "C" size_t LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) {
+  assert(false && "LLVMFuzzerMutate should not be called from afl_driver");
+  return 0;
+}
+
 int main(int argc, char **argv) {
   fprintf(stderr, "======================= INFO =========================\n"
                   "This binary is built for AFL-fuzz.\n"