[llvm] r303087 - [libFuzzer] fix a warning from Wunreachable-code-loop-increment reported by Christian Holler. This also fixes a logical bug, which however does not affect the libFuzzer's ability too much (I wasn't able to create a differentiating test)

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 10:39:42 PDT 2017


Author: kcc
Date: Mon May 15 12:39:42 2017
New Revision: 303087

URL: http://llvm.org/viewvc/llvm-project?rev=303087&view=rev
Log:
[libFuzzer] fix a warning from Wunreachable-code-loop-increment reported by Christian Holler. This also fixes a logical bug, which however does not affect the libFuzzer's ability too much (I wasn't able to create a differentiating test)

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp

Modified: llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp?rev=303087&r1=303086&r2=303087&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp Mon May 15 12:39:42 2017
@@ -222,7 +222,7 @@ DictionaryEntry MutationDispatcher::Make
       if (!Cur) break;
       Positions[NumPositions++] = Cur - Data;
     }
-    if (!NumPositions) break;
+    if (!NumPositions) continue;
     return DictionaryEntry(W, Positions[Rand(NumPositions)]);
   }
   DictionaryEntry DE(W);




More information about the llvm-commits mailing list