* fix minimizer

* clp
This commit is contained in:
Dongjia "toka" Zhang 2024-07-18 11:11:37 +02:00 committed by GitHub
parent 4f970baa7b
commit 56d70accf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -99,6 +99,9 @@ where
EM: EventFirer<State = E::State>, EM: EventFirer<State = E::State>,
Z: HasScheduler<Scheduler = CS, State = E::State>, Z: HasScheduler<Scheduler = CS, State = E::State>,
{ {
// don't delete this else it won't work after restart
let current = *state.corpus().current();
let cfg = Config::default(); let cfg = Config::default();
let ctx = Context::new(&cfg); let ctx = Context::new(&cfg);
let opt = Optimize::new(&ctx); let opt = Optimize::new(&ctx);
@ -224,6 +227,10 @@ where
// reverse order; if indexes are stored in a vec, we need to remove from back to front // reverse order; if indexes are stored in a vec, we need to remove from back to front
removed.sort_unstable_by(|id1, id2| id2.cmp(id1)); removed.sort_unstable_by(|id1, id2| id2.cmp(id1));
for id in removed { for id in removed {
if let Some(_cur) = current {
continue;
}
let removed = state.corpus_mut().remove(id)?; let removed = state.corpus_mut().remove(id)?;
// scheduler needs to know we've removed the input, or it will continue to try // scheduler needs to know we've removed the input, or it will continue to try
// to use now-missing inputs // to use now-missing inputs

View File

@ -48,6 +48,7 @@ where
Self::State: HasCorpus, Self::State: HasCorpus,
{ {
/// Removed the given entry from the corpus at the given index /// Removed the given entry from the corpus at the given index
/// When you remove testcases, make sure that that testcase is not currently fuzzed one!
fn on_remove( fn on_remove(
&mut self, &mut self,
_state: &mut Self::State, _state: &mut Self::State,