Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/libafl/src/corpus/minimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ use crate::{
///
/// Algorithm based on WMOPT: <https://hexhive.epfl.ch/publications/files/21ISSTA2.pdf>
#[derive(Debug)]
pub struct MapCorpusMinimizer<C, E, I, O, S, T, TS> {
pub struct MapCorpusMinimizer<C, E, I, O, S, T, TP> {
observer_handle: Handle<C>,
phantom: PhantomData<(E, I, O, S, T, TS)>,
phantom: PhantomData<(E, I, O, S, T, TP)>,
}

/// Standard corpus minimizer, which weights inputs by length and time.
pub type StdCorpusMinimizer<C, E, I, O, S, T> =
MapCorpusMinimizer<C, E, I, O, S, T, LenTimeMulTestcasePenalty>;

impl<C, E, I, O, S, T, TS> MapCorpusMinimizer<C, E, I, O, S, T, TS>
impl<C, E, I, O, S, T, TP> MapCorpusMinimizer<C, E, I, O, S, T, TP>
where
C: Named,
{
Expand All @@ -52,14 +52,14 @@ where
}
}

impl<C, E, I, O, S, T, TS> MapCorpusMinimizer<C, E, I, O, S, T, TS>
impl<C, E, I, O, S, T, TP> MapCorpusMinimizer<C, E, I, O, S, T, TP>
where
for<'a> O: MapObserver<Entry = T> + AsIter<'a, Item = T>,
C: AsRef<O>,
I: Input,
S: HasMetadata + HasCorpus<I> + HasExecutions,
T: Copy + Hash + Eq,
TS: TestcasePenalty<I, S>,
TP: TestcasePenalty<I, S>,
{
/// Do the minimization
#[expect(clippy::too_many_lines)]
Expand Down Expand Up @@ -121,7 +121,7 @@ where

let mut testcase = state.corpus().get(id)?.borrow_mut();
(
TS::compute(state, &mut *testcase)?
TP::compute(state, &mut *testcase)?
.to_u64()
.expect("Weight must be computable."),
*state.executions(),
Expand Down
Loading