summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerDriver.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-11-03 18:57:25 +0000
committerKostya Serebryany <kcc@google.com>2015-11-03 18:57:25 +0000
commit856b7afe60efa9beaefe11c12a0c7e641c4110eb (patch)
tree2db3b89e06f553d439db7e088e5895ffbcc66a53 /llvm/lib/Fuzzer/FuzzerDriver.cpp
parent43e2e251ea20ab7c77e137b8660c06452fc9bc1a (diff)
downloadbcm5719-llvm-856b7afe60efa9beaefe11c12a0c7e641c4110eb.tar.gz
bcm5719-llvm-856b7afe60efa9beaefe11c12a0c7e641c4110eb.zip
[libFuzzer] make -test_single_input more reliable: make sure the input's size is equal to it's capacity
llvm-svn: 251961
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerDriver.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerDriver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerDriver.cpp b/llvm/lib/Fuzzer/FuzzerDriver.cpp
index 821d34cccc2..363abc482cb 100644
--- a/llvm/lib/Fuzzer/FuzzerDriver.cpp
+++ b/llvm/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);
- F->ExecuteCallback(U);
+ Unit PreciseSizedU(U);
+ assert(PreciseSizedU.size() == PreciseSizedU.capacity());
+ F->ExecuteCallback(PreciseSizedU);
return 0;
}
OpenPOWER on IntegriCloud