From 488234786853cbcadd1341325fea8499e955331c Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 29 Aug 2022 14:30:26 -0700 Subject: [PATCH] Disable funcref generation for fuzz tests with inputs (#4797) This fixes #4757, fixes #4758, and fixes new fuzzbugs that are probably coming after we merged #4667. --- cranelift/fuzzgen/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cranelift/fuzzgen/src/lib.rs b/cranelift/fuzzgen/src/lib.rs index 8dce6e0213..cde0d8ab72 100644 --- a/cranelift/fuzzgen/src/lib.rs +++ b/cranelift/fuzzgen/src/lib.rs @@ -190,6 +190,11 @@ where } pub fn generate_test(mut self) -> Result { + // If we're generating test inputs as well as a function, then we're planning to execute + // this function. That means that any function references in it need to exist. We don't yet + // have infrastructure for generating multiple functions, so just don't generate funcrefs. + self.config.funcrefs_per_function = 0..=0; + let func = self.generate_func()?; let inputs = self.generate_test_inputs(&func.signature)?; Ok(TestCase { func, inputs })