projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[libFuzzer] make -test_single_input more reliable: make sure the input's size is...
[oota-llvm.git]
/
lib
/
Fuzzer
/
FuzzerDriver.cpp
diff --git
a/lib/Fuzzer/FuzzerDriver.cpp
b/lib/Fuzzer/FuzzerDriver.cpp
index f9cb28a6e5154e407487207c313722aa02cfd9b1..363abc482cbba6fad1e019961ee5ef29401db05b 100644
(file)
--- a/
lib/Fuzzer/FuzzerDriver.cpp
+++ b/
lib/Fuzzer/FuzzerDriver.cpp
@@
-184,7
+184,9
@@
static int RunInMultipleProcesses(const std::vector<std::string> &Args,
int RunOneTest(Fuzzer *F, const char *InputFilePath) {
Unit U = FileToVector(InputFilePath);
int RunOneTest(Fuzzer *F, const char *InputFilePath) {
Unit U = FileToVector(InputFilePath);
- F->ExecuteCallback(U);
+ Unit PreciseSizedU(U);
+ assert(PreciseSizedU.size() == PreciseSizedU.capacity());
+ F->ExecuteCallback(PreciseSizedU);
return 0;
}
return 0;
}
@@
-269,6
+271,11
@@
int FuzzerDriver(const std::vector<std::string> &Args,
if (Flags.test_single_input)
return RunOneTest(&F, Flags.test_single_input);
if (Flags.test_single_input)
return RunOneTest(&F, Flags.test_single_input);
+ if (Flags.merge) {
+ F.Merge(*Inputs);
+ exit(0);
+ }
+
unsigned Seed = Flags.seed;
// Initialize Seed.
if (Seed == 0)
unsigned Seed = Flags.seed;
// Initialize Seed.
if (Seed == 0)