Cleanup last redundant corpus_idx usages (#1930)
* Cleanup last redundant corpus_idx usages * More cleanup
This commit is contained in:
parent
9b96149f6c
commit
2763d945a3
@ -138,7 +138,7 @@ pub fn main() -> Result<(), Error> {
|
|||||||
|
|
||||||
state.load_initial_inputs_forced(&mut fuzzer, &mut executor, &mut mgr, &[solution_dir])?;
|
state.load_initial_inputs_forced(&mut fuzzer, &mut executor, &mut mgr, &[solution_dir])?;
|
||||||
|
|
||||||
state.set_corpus_idx(CorpusId::from(0usize))?;
|
state.set_corpus_idx(CorpusId::from(0_usize))?;
|
||||||
stages.perform_all(&mut fuzzer, &mut executor, &mut state, &mut mgr)?;
|
stages.perform_all(&mut fuzzer, &mut executor, &mut state, &mut mgr)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -6,7 +6,7 @@ use libafl_bolts::impl_serdeany;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{CorpusId, Testcase},
|
corpus::Testcase,
|
||||||
inputs::BytesInput,
|
inputs::BytesInput,
|
||||||
stages::mutational::{MutatedTransform, MutatedTransformPost},
|
stages::mutational::{MutatedTransform, MutatedTransformPost},
|
||||||
state::{HasCorpus, HasMetadata},
|
state::{HasCorpus, HasMetadata},
|
||||||
@ -111,17 +111,13 @@ where
|
|||||||
{
|
{
|
||||||
type Post = Self;
|
type Post = Self;
|
||||||
|
|
||||||
fn try_transform_from(
|
fn try_transform_from(base: &mut Testcase<BytesInput>, _state: &S) -> Result<Self, Error> {
|
||||||
base: &mut Testcase<BytesInput>,
|
|
||||||
_state: &S,
|
|
||||||
corpus_idx: CorpusId,
|
|
||||||
) -> Result<Self, Error> {
|
|
||||||
let meta = base
|
let meta = base
|
||||||
.metadata_map()
|
.metadata_map()
|
||||||
.get::<GeneralizedInputMetadata>()
|
.get::<GeneralizedInputMetadata>()
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
Error::key_not_found(format!(
|
Error::key_not_found(format!(
|
||||||
"Couldn't find the GeneralizedInputMetadata for corpus entry {corpus_idx}",
|
"Couldn't find the GeneralizedInputMetadata for corpus entry {base:?}",
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.cloned()?;
|
.cloned()?;
|
||||||
|
@ -99,12 +99,13 @@ pub trait Mutator<I, S>: Named {
|
|||||||
) -> Result<MutationResult, Error>;
|
) -> Result<MutationResult, Error>;
|
||||||
|
|
||||||
/// Post-process given the outcome of the execution
|
/// Post-process given the outcome of the execution
|
||||||
|
/// `new_corpus_idx` will be `Some` if a new `Testcase` was created this execution.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn post_exec(
|
fn post_exec(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
_stage_idx: i32,
|
_stage_idx: i32,
|
||||||
_corpus_idx: Option<CorpusId>,
|
_new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -124,12 +125,13 @@ pub trait MultiMutator<I, S>: Named {
|
|||||||
) -> Result<Vec<I>, Error>;
|
) -> Result<Vec<I>, Error>;
|
||||||
|
|
||||||
/// Post-process given the outcome of the execution
|
/// Post-process given the outcome of the execution
|
||||||
|
/// `new_corpus_idx` will be `Some` if a new `Testcase` was created this execution.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn multi_post_exec(
|
fn multi_post_exec(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
_stage_idx: i32,
|
_stage_idx: i32,
|
||||||
_corpus_idx: Option<CorpusId>,
|
_new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -146,11 +148,12 @@ pub trait MutatorsTuple<I, S>: HasLen {
|
|||||||
) -> Result<MutationResult, Error>;
|
) -> Result<MutationResult, Error>;
|
||||||
|
|
||||||
/// Runs the `post_exec` function on all `Mutators` in this `Tuple`.
|
/// Runs the `post_exec` function on all `Mutators` in this `Tuple`.
|
||||||
|
/// `new_corpus_idx` will be `Some` if a new `Testcase` was created this execution.
|
||||||
fn post_exec_all(
|
fn post_exec_all(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error>;
|
) -> Result<(), Error>;
|
||||||
|
|
||||||
/// Gets the [`Mutator`] at the given index and runs the `mutate` function on it.
|
/// Gets the [`Mutator`] at the given index and runs the `mutate` function on it.
|
||||||
@ -163,6 +166,7 @@ pub trait MutatorsTuple<I, S>: HasLen {
|
|||||||
) -> Result<MutationResult, Error>;
|
) -> Result<MutationResult, Error>;
|
||||||
|
|
||||||
/// Gets the [`Mutator`] at the given index and runs the `post_exec` function on it.
|
/// Gets the [`Mutator`] at the given index and runs the `post_exec` function on it.
|
||||||
|
/// `new_corpus_idx` will be `Some` if a new `Testcase` was created this execution.
|
||||||
fn get_and_post_exec(
|
fn get_and_post_exec(
|
||||||
&mut self,
|
&mut self,
|
||||||
index: usize,
|
index: usize,
|
||||||
@ -191,7 +195,7 @@ impl<I, S> MutatorsTuple<I, S> for () {
|
|||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
_stage_idx: i32,
|
_stage_idx: i32,
|
||||||
_corpus_idx: Option<CorpusId>,
|
_new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -213,7 +217,7 @@ impl<I, S> MutatorsTuple<I, S> for () {
|
|||||||
_index: usize,
|
_index: usize,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
_stage_idx: i32,
|
_stage_idx: i32,
|
||||||
_corpus_idx: Option<CorpusId>,
|
_new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -247,10 +251,10 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
self.0.post_exec(state, stage_idx, corpus_idx)?;
|
self.0.post_exec(state, stage_idx, new_corpus_idx)?;
|
||||||
self.1.post_exec_all(state, stage_idx, corpus_idx)
|
self.1.post_exec_all(state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_and_mutate(
|
fn get_and_mutate(
|
||||||
@ -273,13 +277,13 @@ where
|
|||||||
index: usize,
|
index: usize,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
if index == 0 {
|
if index == 0 {
|
||||||
self.0.post_exec(state, stage_idx, corpus_idx)
|
self.0.post_exec(state, stage_idx, new_corpus_idx)
|
||||||
} else {
|
} else {
|
||||||
self.1
|
self.1
|
||||||
.get_and_post_exec(index - 1, state, stage_idx, corpus_idx)
|
.get_and_post_exec(index - 1, state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,9 +324,9 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
self.0.post_exec_all(state, stage_idx, corpus_idx)
|
self.0.post_exec_all(state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_and_mutate(
|
fn get_and_mutate(
|
||||||
@ -340,10 +344,10 @@ where
|
|||||||
index: usize,
|
index: usize,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
self.0
|
self.0
|
||||||
.get_and_post_exec(index, state, stage_idx, corpus_idx)
|
.get_and_post_exec(index, state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn names(&self) -> Vec<&str> {
|
fn names(&self) -> Vec<&str> {
|
||||||
@ -381,10 +385,10 @@ impl<I, S> MutatorsTuple<I, S> for Vec<Box<dyn Mutator<I, S>>> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
for mutator in self.iter_mut() {
|
for mutator in self.iter_mut() {
|
||||||
mutator.post_exec(state, stage_idx, corpus_idx)?;
|
mutator.post_exec(state, stage_idx, new_corpus_idx)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -407,12 +411,12 @@ impl<I, S> MutatorsTuple<I, S> for Vec<Box<dyn Mutator<I, S>>> {
|
|||||||
index: usize,
|
index: usize,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let mutator = self
|
let mutator = self
|
||||||
.get_mut(index)
|
.get_mut(index)
|
||||||
.ok_or_else(|| Error::key_not_found("Mutator with id {index:?} not found."))?;
|
.ok_or_else(|| Error::key_not_found("Mutator with id {index:?} not found."))?;
|
||||||
mutator.post_exec(state, stage_idx, corpus_idx)
|
mutator.post_exec(state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn names(&self) -> Vec<&str> {
|
fn names(&self) -> Vec<&str> {
|
||||||
|
@ -419,7 +419,7 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
_stage_idx: i32,
|
_stage_idx: i32,
|
||||||
_corpus_idx: Option<CorpusId>,
|
_new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let before = self.finds_before;
|
let before = self.finds_before;
|
||||||
let after = state.corpus().count() + state.solutions().count();
|
let after = state.corpus().count() + state.solutions().count();
|
||||||
|
@ -55,9 +55,9 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
M::post_exec(self, state, stage_idx, corpus_idx)
|
M::post_exec(self, state, stage_idx, new_corpus_idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,11 +34,7 @@ where
|
|||||||
{
|
{
|
||||||
type Post = StringIdentificationMetadata;
|
type Post = StringIdentificationMetadata;
|
||||||
|
|
||||||
fn try_transform_from(
|
fn try_transform_from(base: &mut Testcase<BytesInput>, state: &S) -> Result<Self, Error> {
|
||||||
base: &mut Testcase<BytesInput>,
|
|
||||||
state: &S,
|
|
||||||
_corpus_idx: CorpusId,
|
|
||||||
) -> Result<Self, Error> {
|
|
||||||
let input = base.load_input(state.corpus())?.clone();
|
let input = base.load_input(state.corpus())?.clone();
|
||||||
let metadata = base.metadata::<StringIdentificationMetadata>().cloned()?;
|
let metadata = base.metadata::<StringIdentificationMetadata>().cloned()?;
|
||||||
Ok((input, metadata))
|
Ok((input, metadata))
|
||||||
|
@ -6,14 +6,17 @@ use core::{any::type_name, marker::PhantomData};
|
|||||||
use libafl_bolts::{rands::Rand, Named};
|
use libafl_bolts::{rands::Rand, Named};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, CorpusId, HasCurrentCorpusIdx, Testcase},
|
corpus::{Corpus, CorpusId, Testcase},
|
||||||
fuzzer::Evaluator,
|
fuzzer::Evaluator,
|
||||||
inputs::Input,
|
inputs::Input,
|
||||||
mark_feature_time,
|
mark_feature_time,
|
||||||
mutators::{MultiMutator, MutationResult, Mutator},
|
mutators::{MultiMutator, MutationResult, Mutator},
|
||||||
stages::{ExecutionCountRestartHelper, RetryRestartHelper, Stage},
|
stages::{ExecutionCountRestartHelper, RetryRestartHelper, Stage},
|
||||||
start_timer,
|
start_timer,
|
||||||
state::{HasCorpus, HasExecutions, HasMetadata, HasNamedMetadata, HasRand, UsesState},
|
state::{
|
||||||
|
HasCorpus, HasCurrentTestcase, HasExecutions, HasMetadata, HasNamedMetadata, HasRand,
|
||||||
|
UsesState,
|
||||||
|
},
|
||||||
Error,
|
Error,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "introspection")]
|
#[cfg(feature = "introspection")]
|
||||||
@ -30,7 +33,7 @@ pub trait MutatedTransformPost<S>: Sized {
|
|||||||
self,
|
self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
stage_idx: i32,
|
stage_idx: i32,
|
||||||
corpus_idx: Option<CorpusId>,
|
new_corpus_idx: Option<CorpusId>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -51,11 +54,7 @@ where
|
|||||||
type Post: MutatedTransformPost<S>;
|
type Post: MutatedTransformPost<S>;
|
||||||
|
|
||||||
/// Transform the provided testcase into this type
|
/// Transform the provided testcase into this type
|
||||||
fn try_transform_from(
|
fn try_transform_from(base: &mut Testcase<I>, state: &S) -> Result<Self, Error>;
|
||||||
base: &mut Testcase<I>,
|
|
||||||
state: &S,
|
|
||||||
corpus_idx: CorpusId,
|
|
||||||
) -> Result<Self, Error>;
|
|
||||||
|
|
||||||
/// Transform this instance back into the original input type
|
/// Transform this instance back into the original input type
|
||||||
fn try_transform_into(self, state: &S) -> Result<(I, Self::Post), Error>;
|
fn try_transform_into(self, state: &S) -> Result<(I, Self::Post), Error>;
|
||||||
@ -70,11 +69,7 @@ where
|
|||||||
type Post = ();
|
type Post = ();
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn try_transform_from(
|
fn try_transform_from(base: &mut Testcase<I>, state: &S) -> Result<Self, Error> {
|
||||||
base: &mut Testcase<I>,
|
|
||||||
state: &S,
|
|
||||||
_corpus_idx: CorpusId,
|
|
||||||
) -> Result<Self, Error> {
|
|
||||||
state.corpus().load_input_into(base)?;
|
state.corpus().load_input_into(base)?;
|
||||||
Ok(base.input().as_ref().unwrap().clone())
|
Ok(base.input().as_ref().unwrap().clone())
|
||||||
}
|
}
|
||||||
@ -118,17 +113,11 @@ where
|
|||||||
state: &mut Z::State,
|
state: &mut Z::State,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
|
||||||
return Err(Error::illegal_state(
|
|
||||||
"state is not currently processing a corpus index",
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
let num = self.iterations(state)? - self.execs_since_progress_start(state)?;
|
|
||||||
|
|
||||||
start_timer!(state);
|
start_timer!(state);
|
||||||
let mut testcase = state.corpus().get(corpus_idx)?.borrow_mut();
|
let num = self.iterations(state)? - self.execs_since_progress_start(state)?;
|
||||||
let Ok(input) = I::try_transform_from(&mut testcase, state, corpus_idx) else {
|
let mut testcase = state.current_testcase_mut()?;
|
||||||
|
|
||||||
|
let Ok(input) = I::try_transform_from(&mut testcase, state) else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
drop(testcase);
|
drop(testcase);
|
||||||
@ -359,14 +348,8 @@ where
|
|||||||
state: &mut Z::State,
|
state: &mut Z::State,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
let mut testcase = state.current_testcase_mut()?;
|
||||||
return Err(Error::illegal_state(
|
let Ok(input) = I::try_transform_from(&mut testcase, state) else {
|
||||||
"state is not currently processing a corpus index",
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut testcase = state.corpus().get(corpus_idx)?.borrow_mut();
|
|
||||||
let Ok(input) = I::try_transform_from(&mut testcase, state, corpus_idx) else {
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
drop(testcase);
|
drop(testcase);
|
||||||
|
@ -11,7 +11,7 @@ use crate::{
|
|||||||
corpus::HasTestcase,
|
corpus::HasTestcase,
|
||||||
inputs::{BytesInput, HasBytesVec},
|
inputs::{BytesInput, HasBytesVec},
|
||||||
stages::Stage,
|
stages::Stage,
|
||||||
state::{HasCorpus, HasMetadata, State, UsesState},
|
state::{HasCorpus, HasCurrentTestcase, HasMetadata, State, UsesState},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Metadata which stores the list of pre-computed string-like ranges in the input
|
/// Metadata which stores the list of pre-computed string-like ranges in the input
|
||||||
@ -111,13 +111,7 @@ where
|
|||||||
state: &mut Self::State,
|
state: &mut Self::State,
|
||||||
_manager: &mut EM,
|
_manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
let mut tc = state.current_testcase_mut()?;
|
||||||
return Err(Error::illegal_state(
|
|
||||||
"state is not currently processing a corpus index",
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut tc = state.testcase_mut(corpus_idx)?;
|
|
||||||
if tc.has_metadata::<StringIdentificationMetadata>() {
|
if tc.has_metadata::<StringIdentificationMetadata>() {
|
||||||
return Ok(()); // skip recompute
|
return Ok(()); // skip recompute
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ use libafl_bolts::{current_time, impl_serdeany, rands::Rand};
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, HasCurrentCorpusIdx},
|
|
||||||
mark_feature_time,
|
mark_feature_time,
|
||||||
mutators::{MutationResult, Mutator},
|
mutators::{MutationResult, Mutator},
|
||||||
stages::{
|
stages::{
|
||||||
@ -15,7 +14,10 @@ use crate::{
|
|||||||
ExecutionCountRestartHelper, MutationalStage, Stage,
|
ExecutionCountRestartHelper, MutationalStage, Stage,
|
||||||
},
|
},
|
||||||
start_timer,
|
start_timer,
|
||||||
state::{HasCorpus, HasExecutions, HasMetadata, HasNamedMetadata, HasRand, UsesState},
|
state::{
|
||||||
|
HasCorpus, HasCurrentTestcase, HasExecutions, HasMetadata, HasNamedMetadata, HasRand,
|
||||||
|
UsesState,
|
||||||
|
},
|
||||||
Error, Evaluator,
|
Error, Evaluator,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "introspection")]
|
#[cfg(feature = "introspection")]
|
||||||
@ -178,18 +180,12 @@ where
|
|||||||
state: &mut Z::State,
|
state: &mut Z::State,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
|
||||||
return Err(Error::illegal_state(
|
|
||||||
"state is not currently processing a corpus index",
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
let fuzz_time = self.seed_fuzz_time(state)?;
|
let fuzz_time = self.seed_fuzz_time(state)?;
|
||||||
let iters = self.fixed_iters(state)?;
|
let iters = self.fixed_iters(state)?;
|
||||||
|
|
||||||
start_timer!(state);
|
start_timer!(state);
|
||||||
let mut testcase = state.corpus().get(corpus_idx)?.borrow_mut();
|
let mut testcase = state.current_testcase_mut()?;
|
||||||
let Ok(input) = I::try_transform_from(&mut testcase, state, corpus_idx) else {
|
let Ok(input) = I::try_transform_from(&mut testcase, state) else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
drop(testcase);
|
drop(testcase);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user