r249215 - [libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. (following llvm r249214)
Kostya Serebryany via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 2 16:34:38 PDT 2015
Author: kcc
Date: Fri Oct 2 18:34:37 2015
New Revision: 249215
URL: http://llvm.org/viewvc/llvm-project?rev=249215&view=rev
Log:
[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. (following llvm r249214)
Modified:
cfe/trunk/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
cfe/trunk/tools/clang-fuzzer/ClangFuzzer.cpp
Modified: cfe/trunk/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp?rev=249215&r1=249214&r2=249215&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp (original)
+++ cfe/trunk/tools/clang-format/fuzzer/ClangFormatFuzzer.cpp Fri Oct 2 18:34:37 2015
@@ -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;
}
Modified: cfe/trunk/tools/clang-fuzzer/ClangFuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-fuzzer/ClangFuzzer.cpp?rev=249215&r1=249214&r2=249215&view=diff
==============================================================================
--- cfe/trunk/tools/clang-fuzzer/ClangFuzzer.cpp (original)
+++ cfe/trunk/tools/clang-fuzzer/ClangFuzzer.cpp Fri Oct 2 18:34:37 2015
@@ -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(u
std::make_shared<PCHContainerOperations>();
action->runInvocation(Invocation.release(), Files.get(), PCHContainerOps,
&Diags);
+ return 0;
}
More information about the cfe-commits
mailing list