diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2017-08-26 17:17:37 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2017-08-26 17:17:37 +0000 |
commit | d50410bfb1d1fe12e58ea777186501ab7ce1d2a0 (patch) | |
tree | 9bb6e3d7cea24b47c6f68a31555906718ab832a6 /compiler-rt/lib/fuzzer/FuzzerMutate.h | |
parent | de269f4620ea1a14f5537d361b41b15fb65a9110 (diff) | |
download | bcm5719-llvm-d50410bfb1d1fe12e58ea777186501ab7ce1d2a0.tar.gz bcm5719-llvm-d50410bfb1d1fe12e58ea777186501ab7ce1d2a0.zip |
[libFuzzer] Use custom allocators for STL containers in libFuzzer
Avoids ODR violations causing spurious ASAN container overflow warnings.
Differential Revision: https://reviews.llvm.org/D37086
llvm-svn: 311830
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerMutate.h')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerMutate.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerMutate.h b/compiler-rt/lib/fuzzer/FuzzerMutate.h index 84b04c0dbf3..d1613b22bc6 100644 --- a/compiler-rt/lib/fuzzer/FuzzerMutate.h +++ b/compiler-rt/lib/fuzzer/FuzzerMutate.h @@ -96,7 +96,7 @@ private: size_t AddWordFromDictionary(Dictionary &D, uint8_t *Data, size_t Size, size_t MaxSize); size_t MutateImpl(uint8_t *Data, size_t Size, size_t MaxSize, - const std::vector<Mutator> &Mutators); + const fuzzer::vector<Mutator> &Mutators); size_t InsertPartOf(const uint8_t *From, size_t FromSize, uint8_t *To, size_t ToSize, size_t MaxToSize); @@ -128,21 +128,21 @@ private: // entries that led to successfull discoveries in the past mutations. Dictionary PersistentAutoDictionary; - std::vector<Mutator> CurrentMutatorSequence; - std::vector<DictionaryEntry *> CurrentDictionaryEntrySequence; + fuzzer::vector<Mutator> CurrentMutatorSequence; + fuzzer::vector<DictionaryEntry *> CurrentDictionaryEntrySequence; static const size_t kCmpDictionaryEntriesDequeSize = 16; DictionaryEntry CmpDictionaryEntriesDeque[kCmpDictionaryEntriesDequeSize]; size_t CmpDictionaryEntriesDequeIdx = 0; const InputCorpus *Corpus = nullptr; - std::vector<uint8_t> MutateInPlaceHere; + fuzzer::vector<uint8_t> MutateInPlaceHere; // CustomCrossOver needs its own buffer as a custom implementation may call // LLVMFuzzerMutate, which in turn may resize MutateInPlaceHere. - std::vector<uint8_t> CustomCrossOverInPlaceHere; + fuzzer::vector<uint8_t> CustomCrossOverInPlaceHere; - std::vector<Mutator> Mutators; - std::vector<Mutator> DefaultMutators; + fuzzer::vector<Mutator> Mutators; + fuzzer::vector<Mutator> DefaultMutators; }; } // namespace fuzzer |