diff --git a/compiler-rt/lib/fuzzer/FuzzerMutate.cpp b/compiler-rt/lib/fuzzer/FuzzerMutate.cpp --- a/compiler-rt/lib/fuzzer/FuzzerMutate.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerMutate.cpp @@ -478,8 +478,14 @@ DE->IncSuccessCount(); assert(DE->GetW().size()); // Linear search is fine here as this happens seldom. - if (!PersistentAutoDictionary.ContainsWord(DE->GetW())) - PersistentAutoDictionary.push_back({DE->GetW(), 1}); + if (!PersistentAutoDictionary.ContainsWord(DE->GetW())) { + if (DE->HasPositionHint()) { + PersistentAutoDictionary.push_back({DE->GetW(), DE->GetPositionHint()}); + } else { + PersistentAutoDictionary.push_back( + {DE->GetW(), std::numeric_limits::max()}); + } + } } }