[llvm] r297891 - [libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.
Bruno Cardoso Lopes via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 16 10:08:53 PDT 2017
Thanks!
On Wed, Mar 15, 2017 at 4:20 PM, Vitaly Buka <vitalybuka at google.com> wrote:
> Thanks. Reverted r297912
>
> On Wed, Mar 15, 2017 at 3:54 PM Bruno Cardoso Lopes <
> bruno.cardoso at gmail.com> wrote:
>
>> Hi,
>>
>> Looks like this triggered a test to fail in http://green.lab.llvm.org/
>> green/job/libFuzzer/837, can you take a look?
>>
>> On Wed, Mar 15, 2017 at 1:59 PM, Vitaly Buka via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>> Author: vitalybuka
>> Date: Wed Mar 15 15:59:27 2017
>> New Revision: 297891
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=297891&view=rev
>> Log:
>> [libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.
>>
>> Differential Revision: https://reviews.llvm.org/D30683
>>
>> Modified:
>> llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp
>> llvm/trunk/lib/Fuzzer/FuzzerMutate.h
>>
>> Modified: llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/
>> FuzzerMutate.cpp?rev=297891&r1=297890&r2=297891&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp (original)
>> +++ llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp Wed Mar 15 15:59:27 2017
>> @@ -77,7 +77,7 @@ size_t MutationDispatcher::Mutate_Custom
>> size_t MaxSize) {
>> if (!Corpus || Corpus->size() < 2 || Size == 0)
>> return 0;
>> - size_t Idx = Rand(Corpus->size());
>> + size_t Idx = Corpus->ChooseUnitIdxToMutate(Rand);
>> const Unit &Other = (*Corpus)[Idx];
>> if (Other.empty())
>> return 0;
>>
>> Modified: llvm/trunk/lib/Fuzzer/FuzzerMutate.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/
>> FuzzerMutate.h?rev=297891&r1=297890&r2=297891&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Fuzzer/FuzzerMutate.h (original)
>> +++ llvm/trunk/lib/Fuzzer/FuzzerMutate.h Wed Mar 15 15:59:27 2017
>> @@ -88,7 +88,7 @@ public:
>> void ClearAutoDictionary();
>> void PrintRecommendedDictionary();
>>
>> - void SetCorpus(const InputCorpus *Corpus) { this->Corpus = Corpus; }
>> + void SetCorpus(InputCorpus *Corpus) { this->Corpus = Corpus; }
>>
>> Random &GetRand() { return Rand; }
>>
>> @@ -141,7 +141,7 @@ private:
>> DictionaryEntry CmpDictionaryEntriesDeque[
>> kCmpDictionaryEntriesDequeSize];
>> size_t CmpDictionaryEntriesDequeIdx = 0;
>>
>> - const InputCorpus *Corpus = nullptr;
>> + InputCorpus *Corpus = nullptr;
>> std::vector<uint8_t> MutateInPlaceHere;
>> // CustomCrossOver needs its own buffer as a custom implementation may
>> call
>> // LLVMFuzzerMutate, which in turn may resize MutateInPlaceHere.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>>
>>
>> --
>> Bruno Cardoso Lopes
>> http://www.brunocardoso.cc
>>
>
--
Bruno Cardoso Lopes
http://www.brunocardoso.cc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170316/47c76fd2/attachment.html>
More information about the llvm-commits
mailing list