diff --git a/fuzzers/FRET/src/systemstate/mutational.rs b/fuzzers/FRET/src/systemstate/mutational.rs index e401443f0d..f10f86aea6 100644 --- a/fuzzers/FRET/src/systemstate/mutational.rs +++ b/fuzzers/FRET/src/systemstate/mutational.rs @@ -171,21 +171,16 @@ where let hist = metadata.get::().unwrap(); let maxtick : u64 = hist.1.0; drop(hist); - if interrupt_offsets[0] as u64 > maxtick { // place interrupt in reachable range - do_rerun = true; - for _ in 0..num_interrupts { - prefix.push(u32::to_le_bytes(myrand.between(0, min(maxtick as usize, u32::MAX as usize)).try_into().expect("ticks > u32"))); - } - } else { + { let choice = myrand.between(1,100); - if choice <= 25 { // 0.5*0.25 = 12.5% of the time fully randomize all interrupts + if choice <= 25 || *interrupt_offsets.get(0).unwrap_or(&u32::MAX) as u64 > maxtick { // 0.5*0.25 = 12.5% of the time fully randomize all interrupts do_rerun = true; // let metadata = state.metadata_map(); let hist = metadata.get::().unwrap(); let maxtick : u64 = hist.1.0; // let maxtick : u64 = (_input.exec_time().expect("No duration found").as_nanos() >> 4).try_into().unwrap(); let mut numbers : Vec = vec![]; - for i in 0..num_interrupts { + for i in 0..myrand.between(0,2*min(MAX_NUM_INTERRUPT, maxtick as usize / unsafe{MINIMUM_INTER_ARRIVAL_TIME as usize})) { prefix.push(u32::to_le_bytes(myrand.between(0, min(maxtick, u32::MAX as u64) as usize).try_into().expect("ticks > u32"))); } }