summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerDriver.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-01-16 03:53:32 +0000
committerKostya Serebryany <kcc@google.com>2016-01-16 03:53:32 +0000
commit476f0ce31a442f5fadc3e0978c2e3190faf96447 (patch)
tree5dadf11893d75cf52ee4d2445408b3046ecc469d /llvm/lib/Fuzzer/FuzzerDriver.cpp
parent33ff1dda6a2638f4e1040c282ddc75e5e4483871 (diff)
downloadbcm5719-llvm-476f0ce31a442f5fadc3e0978c2e3190faf96447.tar.gz
bcm5719-llvm-476f0ce31a442f5fadc3e0978c2e3190faf96447.zip
[libFuzzer] replace vector with a simpler data structure in the Dictionaries to avoid memory allocations on hot path
llvm-svn: 257985
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerDriver.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerDriver.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerDriver.cpp b/llvm/lib/Fuzzer/FuzzerDriver.cpp
index 4ae14bb0bb7..f3743ffb8e4 100644
--- a/llvm/lib/Fuzzer/FuzzerDriver.cpp
+++ b/llvm/lib/Fuzzer/FuzzerDriver.cpp
@@ -301,7 +301,8 @@ int FuzzerDriver(const std::vector<std::string> &Args,
Fuzzer F(USF, Options);
for (auto &U: Dictionary)
- USF.GetMD().AddWordToManualDictionary(U);
+ if (U.size() <= Word::GetMaxSize())
+ USF.GetMD().AddWordToManualDictionary(Word(U.data(), U.size()));
// Timer
if (Flags.timeout > 0)
OpenPOWER on IntegriCloud