]> granicus.if.org Git - clang/commitdiff
[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int inste...
authorKostya Serebryany <kcc@google.com>
Fri, 2 Oct 2015 23:34:37 +0000 (23:34 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 2 Oct 2015 23:34:37 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249215 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
tools/clang-fuzzer/ClangFuzzer.cpp

index fe4941a5ba1a07db0cca686d38d45214469310fa..5334ce873eca40e7281c451a25d7a2b00c210736 100644 (file)
 
 #include "clang/Format/Format.h"
 
-extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
+extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   // FIXME: fuzz more things: different styles, different style features.
   std::string s((const char *)data, size);
   auto Style = getGoogleStyle(clang::format::FormatStyle::LK_Cpp);
   Style.ColumnLimit = 60;
   applyAllReplacements(s, clang::format::reformat(
                               Style, s, {clang::tooling::Range(0, s.size())}));
+  return 0;
 }
index 81b2f2fe197e3f0c21b558d7cccf29d1b3d7be72..d07cf5027b2a5a4c86bd4a2d8cbaa460119c3574 100644 (file)
@@ -20,7 +20,7 @@
 
 using namespace clang;
 
-extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
+extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   std::string s((const char *)data, size);
   llvm::opt::ArgStringList CC1Args;
   CC1Args.push_back("-cc1");
@@ -43,4 +43,5 @@ extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
       std::make_shared<PCHContainerOperations>();
   action->runInvocation(Invocation.release(), Files.get(), PCHContainerOps,
                         &Diags);
+  return 0;
 }