<div dir="ltr">Hi,<div><br></div><div>Looks like this triggered a test to fail in <a href="http://green.lab.llvm.org/green/job/libFuzzer/837">http://green.lab.llvm.org/green/job/libFuzzer/837</a>, can you take a look?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 1:59 PM, Vitaly Buka via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vitalybuka<br>
Date: Wed Mar 15 15:59:27 2017<br>
New Revision: 297891<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=297891&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=297891&view=rev</a><br>
Log:<br>
[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D30683" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D30683</a><br>
<br>
Modified:<br>
    llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.cpp<br>
    llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.h<br>
<br>
Modified: llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp?rev=297891&r1=297890&r2=297891&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.cpp?rev=297891&<wbr>r1=297890&r2=297891&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.cpp (original)<br>
+++ llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.cpp Wed Mar 15 15:59:27 2017<br>
@@ -77,7 +77,7 @@ size_t MutationDispatcher::Mutate_<wbr>Custom<br>
                                                   size_t MaxSize) {<br>
   if (!Corpus || Corpus->size() < 2 || Size == 0)<br>
     return 0;<br>
-  size_t Idx = Rand(Corpus->size());<br>
+  size_t Idx = Corpus->ChooseUnitIdxToMutate(<wbr>Rand);<br>
   const Unit &Other = (*Corpus)[Idx];<br>
   if (Other.empty())<br>
     return 0;<br>
<br>
Modified: llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerMutate.h?rev=297891&r1=297890&r2=297891&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.h?rev=297891&r1=<wbr>297890&r2=297891&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.h (original)<br>
+++ llvm/trunk/lib/Fuzzer/<wbr>FuzzerMutate.h Wed Mar 15 15:59:27 2017<br>
@@ -88,7 +88,7 @@ public:<br>
   void ClearAutoDictionary();<br>
   void PrintRecommendedDictionary();<br>
<br>
-  void SetCorpus(const InputCorpus *Corpus) { this->Corpus = Corpus; }<br>
+  void SetCorpus(InputCorpus *Corpus) { this->Corpus = Corpus; }<br>
<br>
   Random &GetRand() { return Rand; }<br>
<br>
@@ -141,7 +141,7 @@ private:<br>
   DictionaryEntry CmpDictionaryEntriesDeque[<wbr>kCmpDictionaryEntriesDequeSize<wbr>];<br>
   size_t CmpDictionaryEntriesDequeIdx = 0;<br>
<br>
-  const InputCorpus *Corpus = nullptr;<br>
+  InputCorpus *Corpus = nullptr;<br>
   std::vector<uint8_t> MutateInPlaceHere;<br>
   // CustomCrossOver needs its own buffer as a custom implementation may call<br>
   // LLVMFuzzerMutate, which in turn may resize MutateInPlaceHere.<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Bruno Cardoso Lopes <br><a href="http://www.brunocardoso.cc" target="_blank">http://www.brunocardoso.cc</a></div>
</div>