Fix crossover mutators for empty multipart inputs (#2663)
This commit is contained in:
parent
87e4a845e0
commit
4431f069e5
@ -135,6 +135,9 @@ where
|
|||||||
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||||
if let Some(cur) = state.corpus().current() {
|
if let Some(cur) = state.corpus().current() {
|
||||||
if id == *cur {
|
if id == *cur {
|
||||||
|
if input.names().is_empty() {
|
||||||
|
return Ok(MutationResult::Skipped);
|
||||||
|
}
|
||||||
let choice = name_choice % input.names().len();
|
let choice = name_choice % input.names().len();
|
||||||
let name = input.names()[choice].clone();
|
let name = input.names()[choice].clone();
|
||||||
|
|
||||||
@ -264,6 +267,9 @@ where
|
|||||||
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||||
if let Some(cur) = state.corpus().current() {
|
if let Some(cur) = state.corpus().current() {
|
||||||
if id == *cur {
|
if id == *cur {
|
||||||
|
if input.names().is_empty() {
|
||||||
|
return Ok(MutationResult::Skipped);
|
||||||
|
}
|
||||||
let choice = name_choice % input.names().len();
|
let choice = name_choice % input.names().len();
|
||||||
let name = input.names()[choice].clone();
|
let name = input.names()[choice].clone();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user