oss-fuzz: debug code to output testcase in file code.cpp

This commit is contained in:
Daniel Marjamäki 2019-04-11 09:03:29 +02:00
parent 3c1f6ae5c2
commit 548ddf815c
1 changed files with 6 additions and 1 deletions

View File

@ -30,8 +30,13 @@ public:
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize)
{ {
if (dataSize < 10000) { if (dataSize < 10000) {
const std::string code = generateCode2(data, dataSize);
//std::ofstream fout("code.cpp");
//fout << code;
//fout.close();
CppcheckExecutor cppcheckExecutor; CppcheckExecutor cppcheckExecutor;
cppcheckExecutor.run(generateCode2(data, dataSize)); cppcheckExecutor.run(code);
} }
return 0; return 0;
} }