fix bug causing skipped mutation when part size is 0
This commit is contained in:
parent
72f9de45d0
commit
3b6cd3bc45
@ -299,6 +299,10 @@ where
|
|||||||
drop(other_testcase);
|
drop(other_testcase);
|
||||||
let size = part.bytes().len();
|
let size = part.bytes().len();
|
||||||
|
|
||||||
|
if size == 0 { // Workaround for a bug where parts are empty. The origin remains unknown.
|
||||||
|
return Ok(MutationResult::Skipped);
|
||||||
|
}
|
||||||
|
|
||||||
let target = state.rand_mut().below(size);
|
let target = state.rand_mut().below(size);
|
||||||
let range = rand_range(state, other_size, min(other_size, size - target));
|
let range = rand_range(state, other_size, min(other_size, size - target));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user