Skip to content

Commit

Permalink
Reduce risk of fuzzing code being optimised away
Browse files Browse the repository at this point in the history
Since the resut of format!() wasn't used, maybe the optimiser could remove the
calls.  No evidence this was actually happening.
  • Loading branch information
dholroyd committed Feb 20, 2024
1 parent b6af22a commit f4c9cbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fuzz/fuzz_targets/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ impl SpliceInfoProcessor for FuzzSpliceInfoProcessor {
descriptors: SpliceDescriptors<'_>,
) {
// The debug implementations should call every accessor method under the hood,
format!("{:?}", header);
format!("{:?}", command);
std::hint::black_box(format!("{:?}", header));
std::hint::black_box(format!("{:?}", command));

for d in &descriptors {
format!("{:?}", d);
std::hint::black_box(format!("{:?}", d));
}
}
}
Expand Down

0 comments on commit f4c9cbd

Please sign in to comment.