Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tooling/ast_fuzzer/fuzz/src/targets/comptime_vs_brillig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions tooling/ast_fuzzer/src/program/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,14 @@
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))
}
Expand Down Expand Up @@ -1325,9 +1332,9 @@
ctx.config.max_loop_size = 10;
ctx.config.vary_loop_size = false;
ctx.gen_main_decl(&mut u);
let mut fctx = FunctionContext::new(&mut ctx, FuncId(0));

Check warning on line 1335 in tooling/ast_fuzzer/src/program/func.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fctx)
fctx.budget = 2;

Check warning on line 1336 in tooling/ast_fuzzer/src/program/func.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fctx)
let loop_code = format!("{}", fctx.gen_loop(&mut u).unwrap()).replace(" ", "");

Check warning on line 1337 in tooling/ast_fuzzer/src/program/func.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fctx)

println!("{loop_code}");
assert!(
Expand All @@ -1351,8 +1358,8 @@
ctx.config.max_loop_size = 10;
ctx.config.vary_loop_size = false;
ctx.gen_main_decl(&mut u);
let mut fctx = FunctionContext::new(&mut ctx, FuncId(0));

Check warning on line 1361 in tooling/ast_fuzzer/src/program/func.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fctx)
fctx.budget = 2;

Check warning on line 1362 in tooling/ast_fuzzer/src/program/func.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (fctx)
let while_code = format!("{}", fctx.gen_while(&mut u).unwrap()).replace(" ", "");

println!("{while_code}");
Expand Down
Loading