From: Kostya Serebryany Date: Mon, 15 May 2017 17:39:42 +0000 (+0000) Subject: [libFuzzer] fix a warning from Wunreachable-code-loop-increment reported by Christian... X-Git-Tag: submit/tizen/20170714.013956~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51fc14b6b9208eea369695803faabd38fc6376d5;p=tools%2FlibFuzzer.git [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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303087 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Fuzzer/FuzzerMutate.cpp b/lib/Fuzzer/FuzzerMutate.cpp index a84e6ee..e60d413 100644 --- a/lib/Fuzzer/FuzzerMutate.cpp +++ b/lib/Fuzzer/FuzzerMutate.cpp @@ -222,7 +222,7 @@ DictionaryEntry MutationDispatcher::MakeDictionaryEntryFromCMP( if (!Cur) break; Positions[NumPositions++] = Cur - Data; } - if (!NumPositions) break; + if (!NumPositions) continue; return DictionaryEntry(W, Positions[Rand(NumPositions)]); } DictionaryEntry DE(W);