Make ByteNegMutator negate, not flip (#675)

Change the ByteNegMutator to negate a byte, not flip it. Flipping a byte is already implemented in ByteFlipMutator.

See issue: https://github.com/AFLplusplus/LibAFL/issues/674
This commit is contained in:
Tobias Scharnowski 2022-07-04 16:37:36 +02:00 committed by GitHub
parent d9a0948377
commit be3d1d588f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ where
Ok(MutationResult::Skipped)
} else {
let byte = state.rand_mut().choose(input.bytes_mut());
*byte = !*byte;
*byte = (-(*byte as i16)) as u8;
Ok(MutationResult::Mutated)
}
}