Disable check_label_branch_invariants in fuzzing

This commit disables the `MachBuffer::check_label_branch_invariants`
debug check on the fuzzers due to it causing timeouts with the test case
from #3441. Fuzzing leads to a 20-30x slowdown of executed code and
locally the fuzz time it takes to instantiate #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.
This commit is contained in:
Alex Crichton
2021-11-15 07:32:24 -08:00
parent ff1af20479
commit 1548ca3c47

View File

@@ -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();