Skip to content

Commit 3b8626d

Browse files
authored
Update mutations.rs to use wrapping_neg (AFLplusplus#3516)
This does the same two complements negation but with Rust API: https://doc.rust-lang.org/std/primitive.u8.html#method.wrapping_neg
1 parent da33eab commit 3b8626d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/libafl/src/mutators/mutations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ where
308308
Ok(MutationResult::Skipped)
309309
} else {
310310
let byte = state.rand_mut().choose(input.mutator_bytes_mut()).unwrap();
311-
*byte = (!(*byte)).wrapping_add(1);
311+
*byte = byte.wrapping_neg();
312312
Ok(MutationResult::Mutated)
313313
}
314314
}

0 commit comments

Comments
 (0)