summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-10-02 23:34:37 +0000
committerKostya Serebryany <kcc@google.com>2015-10-02 23:34:37 +0000
commite39fec5b0664c10ef5ebcb2a84bb4d7dcd807e1a (patch)
tree121d1ac4d7a5d87eba1d45dee0e540e9229e13b1
parent20bb5e71b25ba3f2debef4035dc8b5def7d1763c (diff)
downloadbcm5719-llvm-e39fec5b0664c10ef5ebcb2a84bb4d7dcd807e1a.tar.gz
bcm5719-llvm-e39fec5b0664c10ef5ebcb2a84bb4d7dcd807e1a.zip
[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. (following llvm r249214)
llvm-svn: 249215
-rw-r--r--clang/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp3
-rw-r--r--clang/tools/clang-fuzzer/ClangFuzzer.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp b/clang/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
index fe4941a5ba1..5334ce873ec 100644
--- a/clang/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
+++ b/clang/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
@@ -15,11 +15,12 @@
#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;
}
diff --git a/clang/tools/clang-fuzzer/ClangFuzzer.cpp b/clang/tools/clang-fuzzer/ClangFuzzer.cpp
index 81b2f2fe197..d07cf5027b2 100644
--- a/clang/tools/clang-fuzzer/ClangFuzzer.cpp
+++ b/clang/tools/clang-fuzzer/ClangFuzzer.cpp
@@ -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;
}
OpenPOWER on IntegriCloud