diff --git a/tooling/ast_fuzzer/fuzz/src/targets/comptime_vs_brillig.rs b/tooling/ast_fuzzer/fuzz/src/targets/comptime_vs_brillig.rs index b65ace0137d..552d8c39d0a 100644 --- a/tooling/ast_fuzzer/fuzz/src/targets/comptime_vs_brillig.rs +++ b/tooling/ast_fuzzer/fuzz/src/targets/comptime_vs_brillig.rs @@ -21,7 +21,7 @@ pub fn fuzz(u: &mut Unstructured) -> eyre::Result<()> { avoid_err_by_zero: true, // and it gets old to have to edit u128 to fit into u32 for the frontend to parse avoid_large_int_literals: true, - // Avoid break/continue (until #8382 is merged) + // Avoid break/continue avoid_loop_control: true, // Has to only use expressions valid in comptime comptime_friendly: true, diff --git a/tooling/ast_fuzzer/src/program/func.rs b/tooling/ast_fuzzer/src/program/func.rs index 1dee409562f..251f2ae73df 100644 --- a/tooling/ast_fuzzer/src/program/func.rs +++ b/tooling/ast_fuzzer/src/program/func.rs @@ -758,7 +758,14 @@ impl<'a> FunctionContext<'a> { let max_depth = self.max_depth(); let comptime_friendly = self.is_comptime_friendly(); let typ = self.ctx.gen_type(u, max_depth, false, false, true, comptime_friendly)?; + + // Temporarily set in_loop to false to disallow breaking/continuing out + // of the let blocks (which would lead to frontend errors when reversing + // the AST into Noir) + let was_in_loop = std::mem::replace(&mut self.in_loop, false); let expr = self.gen_expr(u, &typ, max_depth, Flags::TOP)?; + self.in_loop = was_in_loop; + let mutable = bool::arbitrary(u)?; Ok(self.let_var(mutable, typ, expr, true)) }