• Home
  • Raw
  • Download

Lines Matching refs:Rand

21 MutationDispatcher::MutationDispatcher(Random &Rand,  in MutationDispatcher()  argument
23 : Rand(Rand), Options(Options) { in MutationDispatcher()
52 static char FlipRandomBit(char X, Random &Rand) { in FlipRandomBit() argument
53 int Bit = Rand(8); in FlipRandomBit()
64 static char RandCh(Random &Rand) { in RandCh() argument
65 if (Rand.RandBool()) return Rand(256); in RandCh()
67 return Special[Rand(sizeof(Special) - 1)]; in RandCh()
72 return EF->LLVMFuzzerCustomMutator(Data, Size, MaxSize, Rand.Rand()); in Mutate_Custom()
79 size_t Idx = Rand(Corpus->size()); in Mutate_CustomCrossOver()
86 Data, Size, Other.data(), Other.size(), U.data(), U.size(), Rand.Rand()); in Mutate_CustomCrossOver()
98 Rand(std::min(Size, (size_t)8)) + 1; // [1,8] and <= Size. in Mutate_ShuffleBytes()
99 size_t ShuffleStart = Rand(Size - ShuffleAmount); in Mutate_ShuffleBytes()
102 Rand); in Mutate_ShuffleBytes()
110 size_t Idx = Rand(Size); in Mutate_EraseByte()
119 size_t Idx = Rand(Size + 1); in Mutate_InsertByte()
122 Data[Idx] = RandCh(Rand); in Mutate_InsertByte()
128 size_t Idx = Rand(Size); in Mutate_ChangeByte()
129 Data[Idx] = RandCh(Rand); in Mutate_ChangeByte()
135 size_t Idx = Rand(Size); in Mutate_ChangeBit()
136 Data[Idx] = FlipRandomBit(Data[Idx], Rand); in Mutate_ChangeBit()
159 DictionaryEntry &DE = D[Rand(D.size())]; in AddWordFromDictionary()
162 DE.GetPositionHint() + W.size() < Size && Rand.RandBool(); in AddWordFromDictionary()
163 if (Rand.RandBool()) { // Insert W. in AddWordFromDictionary()
165 size_t Idx = UsePositionHint ? DE.GetPositionHint() : Rand(Size + 1); in AddWordFromDictionary()
171 size_t Idx = UsePositionHint ? DE.GetPositionHint() : Rand(Size - W.size()); in AddWordFromDictionary()
181 size_t B = Rand(Size); in Mutate_ChangeASCIIInteger()
194 switch(Rand(5)) { in Mutate_ChangeASCIIInteger()
199 case 4: Val = Rand(Val * Val); break; in Mutate_ChangeASCIIInteger()
215 size_t Idx = Rand(Corpus->size()); in Mutate_CrossOver()
289 Data[i] = RandCh(Rand); in MutateImpl()
299 auto M = Mutators[Rand(Mutators.size())]; in MutateImpl()