Skip to content

Commit

Permalink
Disable check_label_branch_invariants in fuzzing
Browse files Browse the repository at this point in the history
This commit disables the `MachBuffer::check_label_branch_invariants`
debug check on the fuzzers due to it causing timeouts with the test case
from bytecodealliance#3441. Fuzzing leads to a 20-30x slowdown of executed code and
locally the fuzz time it takes to instantiate bytecodealliance#3441 drops from 3 minutes
to 6 seconds disabling this function. Note that this should still be
executed during our testing on CI since it's still enabled for debug
assertions.
  • Loading branch information
alexcrichton committed Nov 15, 2021
1 parent ff1af20 commit 1548ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cranelift/codegen/src/machinst/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl<I: VCodeInst> MachBuffer<I> {
/// times, e.g. after calling `add_{cond,uncond}_branch()` and
/// before emitting branch bytes.
fn check_label_branch_invariants(&self) {
if !cfg!(debug_assertions) {
if !cfg!(debug_assertions) || cfg!(fuzzing) {
return;
}
let cur_off = self.cur_offset();
Expand Down

0 comments on commit 1548ca3

Please sign in to comment.