From f454d174826752349debd5eeae54f78d56f1ba7a Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Thu, 16 Feb 2023 17:28:49 +0100 Subject: [PATCH] CMin: don't add to map if it's the initial value (uninteresting) (#1078) --- libafl/src/corpus/minimizer.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libafl/src/corpus/minimizer.rs b/libafl/src/corpus/minimizer.rs index a0063e4946..50ce83e8ee 100644 --- a/libafl/src/corpus/minimizer.rs +++ b/libafl/src/corpus/minimizer.rs @@ -142,12 +142,14 @@ where // Store coverage, mapping coverage map indices to hit counts (if present) and the // associated seeds for the map indices with those hit counts. for (i, e) in obs.as_iter().copied().enumerate() { - cov_map - .entry(i) - .or_insert_with(HashMap::new) - .entry(e) - .or_insert_with(HashSet::new) - .insert(seed_expr.clone()); + if e != obs.initial() { + cov_map + .entry(i) + .or_insert_with(HashMap::new) + .entry(e) + .or_insert_with(HashSet::new) + .insert(seed_expr.clone()); + } } // Keep track of that seed's index and weight