diff --git a/compiler/noirc_evaluator/src/ssa/ir/instruction.rs b/compiler/noirc_evaluator/src/ssa/ir/instruction.rs index 4dc2022cf82..28db6231869 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/instruction.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/instruction.rs @@ -391,9 +391,17 @@ impl Instruction { Instruction::Call { func, .. } => match dfg[*func] { Value::Function(id) => !matches!(dfg.purity_of(id), Some(Purity::Pure)), Value::Intrinsic(intrinsic) => { - // These utilize `noirc_evaluator::acir::Context::get_flattened_index` internally - // which uses the side effects predicate. - matches!(intrinsic, Intrinsic::SliceInsert | Intrinsic::SliceRemove) + match intrinsic { + // These utilize `noirc_evaluator::acir::Context::get_flattened_index` internally + // which uses the side effects predicate. + Intrinsic::SliceInsert | Intrinsic::SliceRemove => true, + // Technically these don't use the side effects predicate, but they fail on empty slices, + // and by pretending that they require the predicate, we can preserve any current side + // effect variable in the SSA and use it to optimize out memory operations that we know + // would fail, but they shouldn't because they might be disabled. + Intrinsic::SlicePopFront | Intrinsic::SlicePopBack => true, + _ => false, + } } _ => false, }, diff --git a/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs b/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs index 25f063fcd94..bf5487f74e7 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs @@ -275,23 +275,23 @@ mod test { } #[test] - fn remove_enable_side_effects_for_slice_pop_back() { + fn keep_enable_side_effects_for_slice_pop_back() { let src = get_slice_intrinsic_src( "v13, v14, v15", &Intrinsic::SlicePopBack.to_string(), ") -> (u32, [Field], Field)", ); - verify_all_enable_side_effects_removed(&src); + verify_ssa_unchanged(&src); } #[test] - fn remove_enable_side_effects_for_slice_pop_front() { + fn keep_enable_side_effects_for_slice_pop_front() { let src = get_slice_intrinsic_src( "v13, v14, v15", &Intrinsic::SlicePopFront.to_string(), ") -> (Field, u32, [Field])", ); - verify_all_enable_side_effects_removed(&src); + verify_ssa_unchanged(&src); } #[test] diff --git a/compiler/noirc_evaluator/src/ssa/opt/remove_unreachable_instructions.rs b/compiler/noirc_evaluator/src/ssa/opt/remove_unreachable_instructions.rs index 4ea93cabf06..1739a829b20 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/remove_unreachable_instructions.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/remove_unreachable_instructions.rs @@ -17,11 +17,11 @@ use crate::ssa::{ dfg::DataFlowGraph, function::{Function, FunctionId}, instruction::{ - Binary, BinaryOp, ConstrainError, Instruction, TerminatorInstruction, + Binary, BinaryOp, ConstrainError, Instruction, Intrinsic, TerminatorInstruction, binary::{BinaryEvaluationResult, eval_constant_binary_op}, }, types::{NumericType, Type}, - value::ValueId, + value::{Value, ValueId}, }, opt::simple_optimization::SimpleOptimizationContext, ssa_gen::Ssa, @@ -89,19 +89,17 @@ impl Function { if !instruction.requires_acir_gen_predicate(context.dfg) { return; } - // Remove the current instruction and insert defaults for the results. - context.remove_current_instruction(); - - let result_ids = context.dfg.instruction_results(context.instruction_id).to_vec(); - - for result_id in result_ids { - let typ = &context.dfg.type_of_value(result_id); - let default_value = zeroed_value(context.dfg, func_id, block_id, typ); - context.replace_value(result_id, default_value); - } + remove_and_replace_with_defaults(context, func_id, block_id); return; } + // Check if the current predicate is known to be enabled. + let is_predicate_constant_one = + || match context.dfg.get_numeric_constant(side_effects_condition) { + Some(predicate) => predicate.is_one(), + None => false, // The predicate is a variable + }; + match instruction { Instruction::Constrain(lhs, rhs, _) => { let Some(lhs_constant) = context.dfg.get_numeric_constant(*lhs) else { @@ -133,15 +131,8 @@ impl Function { let requires_acir_gen_predicate = binary.requires_acir_gen_predicate(context.dfg); - // Check if the current predicate is known to be enabled. - let is_predicate_constant_one = - match context.dfg.get_numeric_constant(side_effects_condition) { - Some(predicate) => predicate.is_one(), - None => false, // The predicate is a variable - }; - let fails_under_predicate = - requires_acir_gen_predicate && !is_predicate_constant_one; + requires_acir_gen_predicate && !is_predicate_constant_one(); // Insert the instruction right away so we can add a constrain immediately after it context.insert_current_instruction(); @@ -194,12 +185,7 @@ impl Function { }; if array_op_always_fails { - let is_predicate_constant_one = - match context.dfg.get_numeric_constant(side_effects_condition) { - Some(predicate) => predicate.is_one(), - None => false, // The predicate is a variable - }; - current_block_reachability = if is_predicate_constant_one { + current_block_reachability = if is_predicate_constant_one() { // If we have an array that contains references we no longer need to bother with resolution of those references. // However, we want a trap to still be triggered by an OOB array access. // Thus, we can replace our array with dummy numerics to avoid unnecessary allocations @@ -244,6 +230,42 @@ impl Function { }; } } + // Intrinsic Slice operations in ACIR on empty arrays need to be replaced with a (conditional) constraint. + // In Brillig they will be protected by an access constraint, which, if known to fail, will make the block unreachable. + Instruction::Call { func, arguments } if context.dfg.runtime().is_acir() => { + if let Value::Intrinsic(Intrinsic::SlicePopBack | Intrinsic::SlicePopFront) = + &context.dfg[*func] + { + let length = arguments.iter().next().unwrap_or_else(|| { + unreachable!("slice operations have 2 arguments: [length, slice]") + }); + let is_empty = + context.dfg.get_numeric_constant(*length).is_some_and(|v| v.is_zero()); + // If the compiler knows the slice is empty, there is no point trying to pop from it, we know it will fail. + // Barretenberg doesn't handle memory operations with predicates, so we can't rely on those to disable the operation + // based on the current side effect variable. Instead we need to replace it with a conditional constraint. + if is_empty { + let always_fail = is_predicate_constant_one(); + + // We might think that if the predicate is constant 1, we can leave the pop as it will always fail. + // However by turning the block Unreachable, ACIR-gen would create empty bytecode and not fail the circuit. + insert_constraint( + context, + block_id, + side_effects_condition, + "Index out of bounds".to_string(), + ); + + current_block_reachability = if always_fail { + context.remove_current_instruction(); + Reachability::Unreachable + } else { + remove_and_replace_with_defaults(context, func_id, block_id); + Reachability::UnreachableUnderPredicate + }; + } + } + } _ => (), }; @@ -344,6 +366,37 @@ fn zeroed_value( } } +/// Remove the current instruction and replace it with default values. +fn remove_and_replace_with_defaults( + context: &mut SimpleOptimizationContext<'_, '_>, + func_id: FunctionId, + block_id: BasicBlockId, +) { + context.remove_current_instruction(); + + let result_ids = context.dfg.instruction_results(context.instruction_id).to_vec(); + + for result_id in result_ids { + let typ = &context.dfg.type_of_value(result_id); + let default_value = zeroed_value(context.dfg, func_id, block_id, typ); + context.replace_value(result_id, default_value); + } +} + +/// Insert a `constrain 0 == , ""` instruction. +fn insert_constraint( + context: &mut SimpleOptimizationContext<'_, '_>, + block_id: BasicBlockId, + predicate: ValueId, + msg: String, +) { + let zero = context.dfg.make_constant(0_u128.into(), NumericType::bool()); + let message = Some(ConstrainError::StaticString(msg)); + let instruction = Instruction::Constrain(zero, predicate, message); + let call_stack = context.dfg.get_instruction_call_stack_id(context.instruction_id); + context.dfg.insert_instruction_and_results(instruction, block_id, None, call_stack); +} + #[cfg(test)] mod test { use crate::{ @@ -871,11 +924,11 @@ mod test { let src = " acir(inline) predicate_pure fn main f0 { b0(): - v0 = allocate -> &mut u8 - store u8 0 at v0 + v0 = allocate -> &mut u8 + store u8 0 at v0 v2 = make_array [u8 0, v0] : [(u8, &mut u8); 1] - v4 = array_get v2, index u32 2 -> u8 - v6 = array_get v2, index u32 3 -> &mut u8 + v4 = array_get v2, index u32 2 -> u8 + v6 = array_get v2, index u32 3 -> &mut u8 return v4 } "; @@ -904,11 +957,11 @@ mod test { let src = " brillig(inline) predicate_pure fn main f0 { b0(): - v0 = allocate -> &mut u8 - store u8 0 at v0 + v0 = allocate -> &mut u8 + store u8 0 at v0 v2 = make_array [u8 0, v0] : [(u8, &mut u8); 1] - v4 = array_get v2, index u32 2 -> u8 - v6 = array_get v2, index u32 3 -> &mut u8 + v4 = array_get v2, index u32 2 -> u8 + v6 = array_get v2, index u32 3 -> &mut u8 return v4 } "; @@ -917,4 +970,57 @@ mod test { let ssa = ssa.remove_unreachable_instructions(); assert_normalized_ssa_equals(ssa, src); } + + #[test] + fn transforms_failing_slice_pop_with_constraint_and_default() { + let src = " + acir(inline) predicate_pure fn main f0 { + b0(v0: u1): + v1 = make_array [] : [u32] + enable_side_effects v0 + v4, v5, v6 = call slice_pop_front(u32 0, v1) -> (u32, u32, [u32]) + enable_side_effects u1 1 + return u32 1 + } + "; + + let ssa = Ssa::from_str(src).unwrap(); + let ssa = ssa.remove_unreachable_instructions(); + + assert_ssa_snapshot!(ssa, @r#" + acir(inline) predicate_pure fn main f0 { + b0(v0: u1): + v1 = make_array [] : [u32] + enable_side_effects v0 + constrain u1 0 == v0, "Index out of bounds" + v3 = make_array [] : [u32] + enable_side_effects u1 1 + return u32 1 + } + "#); + } + + #[test] + fn transforms_failing_slice_pop_if_always_enabled() { + let src = " + acir(inline) predicate_pure fn main f0 { + b0(v0: u1): + v1 = make_array [] : [u32] + v4, v5, v6 = call slice_pop_front(u32 0, v1) -> (u32, u32, [u32]) + return v4 + } + "; + + let ssa = Ssa::from_str(src).unwrap(); + let ssa = ssa.remove_unreachable_instructions(); + + assert_ssa_snapshot!(ssa, @r#" + acir(inline) predicate_pure fn main f0 { + b0(v0: u1): + v1 = make_array [] : [u32] + constrain u1 0 == u1 1, "Index out of bounds" + unreachable + } + "#); + } } diff --git a/compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs index 77fd1c6ebd1..c9ef052c746 100644 --- a/compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs @@ -1081,16 +1081,19 @@ impl FunctionContext<'_> { Intrinsic::SliceRemove => { self.codegen_access_check(arguments[2], arguments[0]); } - Intrinsic::SlicePopFront | Intrinsic::SlicePopBack => { - // If the slice was empty, ACIR would fail appropriately as we check memory block sizes, - // but for Brillig we need to lay down an explicit check. By doing this in the SSA we - // might be able to optimize this away later. - if self.builder.current_function.runtime().is_brillig() { - let zero = self - .builder - .numeric_constant(0u32, NumericType::Unsigned { bit_size: 32 }); - self.codegen_access_check(zero, arguments[0]); - } + Intrinsic::SlicePopFront | Intrinsic::SlicePopBack + if self.builder.current_function.runtime().is_brillig() => + { + // We need to put in a constraint to protect against accessing empty slices: + // * In Brillig this is essential, otherwise it would read an unrelated piece of memory. + // * In ACIR we do have protection against reading empty slices (it returns "Index Out of Bounds"), so we don't get invalid reads. + // The memory operations in ACIR ignore the side effect variables, so even if we added a constraint here, it could still fail + // when it inevitably tries to read from an empty slice anyway. We have to handle that by removing operations which are known + // to fail and replace them with conditional constraints that do take the side effect into account. + // By doing this in the SSA we might be able to optimize this away later. + let zero = + self.builder.numeric_constant(0u32, NumericType::Unsigned { bit_size: 32 }); + self.codegen_access_check(zero, arguments[0]); } _ => { // Do nothing as the other intrinsics do not require checks diff --git a/test_programs/execution_failure/regression_9489/Nargo.toml b/test_programs/execution_failure/regression_9489/Nargo.toml new file mode 100644 index 00000000000..b97932df666 --- /dev/null +++ b/test_programs/execution_failure/regression_9489/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "regression_9489" +type = "bin" +authors = [""] + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_failure/regression_9489/Prover.toml b/test_programs/execution_failure/regression_9489/Prover.toml new file mode 100644 index 00000000000..66ca132f8d6 --- /dev/null +++ b/test_programs/execution_failure/regression_9489/Prover.toml @@ -0,0 +1 @@ +return = 1 diff --git a/test_programs/execution_failure/regression_9489/src/main.nr b/test_programs/execution_failure/regression_9489/src/main.nr new file mode 100644 index 00000000000..fc233fcb343 --- /dev/null +++ b/test_programs/execution_failure/regression_9489/src/main.nr @@ -0,0 +1,5 @@ +global G_A: [str<0>] = &[]; +fn main() -> pub bool { + let _ = G_A.pop_front().0; + true +} diff --git a/test_programs/execution_success/regression_9467/Nargo.toml b/test_programs/execution_success/regression_9467/Nargo.toml new file mode 100644 index 00000000000..2873017b9c3 --- /dev/null +++ b/test_programs/execution_success/regression_9467/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "regression_9467" +type = "bin" +authors = [""] + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/regression_9467/Prover.toml b/test_programs/execution_success/regression_9467/Prover.toml new file mode 100644 index 00000000000..39630428be1 --- /dev/null +++ b/test_programs/execution_success/regression_9467/Prover.toml @@ -0,0 +1,2 @@ +b = false +return = [1, 2] diff --git a/test_programs/execution_success/regression_9467/src/main.nr b/test_programs/execution_success/regression_9467/src/main.nr new file mode 100644 index 00000000000..91e918d1931 --- /dev/null +++ b/test_programs/execution_success/regression_9467/src/main.nr @@ -0,0 +1,8 @@ +fn main(b: bool) -> pub (u32, u32) { + let s0: [u32] = &[]; + let s1: [u32] = &[10]; + let s2 = if b { s1 } else { s0 }; + let i1 = if b { s0.pop_back().1 } else { 1 }; + let i2 = if b { s2.pop_front().0 } else { 2 }; + (i1, i2) +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__expanded.snap new file mode 100644 index 00000000000..475ff666803 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__expanded.snap @@ -0,0 +1,12 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main(b: bool) -> pub (u32, u32) { + let s0: [u32] = &[]; + let s1: [u32] = &[10_u32]; + let s2: [u32] = if b { s1 } else { s0 }; + let i1: u32 = if b { s0.pop_back().1 } else { 1_u32 }; + let i2: u32 = if b { s2.pop_front().0 } else { 2_u32 }; + (i1, i2) +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..853b04e404d --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,68 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _5", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "EXPR [ (-1, _0) 0 ]", + "EXPR [ (10, _0) (-1, _3) 0 ]", + "INIT (id: 0, len: 1, witnesses: [_3])", + "EXPR [ (-1, _4) 0 ]", + "MEM (id: 0, read at: EXPR [ (1, _4) 0 ], value: EXPR [ (1, _5) 0 ]) ", + "EXPR [ (1, _0) (1, _1) -1 ]", + "EXPR [ (2, _0) (1, _2) -2 ]" + ], + "debug_symbols": "nZHdCoMwDIXfJde98HdTX2UMqRqlUNpS28EQ332x2E0vBmM3SZOTr4GTBQbs/NQKNeoZmtsCnRVSiqmVuudOaEXdZWUQy9ZZRGrBQSfKcIvKQaO8lAweXPowNBuuQnbckpowQDVQpg9HIXF7rexDJ9/RqtjZ6vKGy5/ptLjueFpW//B15LOkPvF3qngv7MkvSGiQQQpNziALMQ+xoLhua6zgncTd29Gr/mC1e5qoxGMYq3scvMVtTdBo8Qs=", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..853b04e404d --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,68 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _5", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "EXPR [ (-1, _0) 0 ]", + "EXPR [ (10, _0) (-1, _3) 0 ]", + "INIT (id: 0, len: 1, witnesses: [_3])", + "EXPR [ (-1, _4) 0 ]", + "MEM (id: 0, read at: EXPR [ (1, _4) 0 ], value: EXPR [ (1, _5) 0 ]) ", + "EXPR [ (1, _0) (1, _1) -1 ]", + "EXPR [ (2, _0) (1, _2) -2 ]" + ], + "debug_symbols": "nZHdCoMwDIXfJde98HdTX2UMqRqlUNpS28EQ332x2E0vBmM3SZOTr4GTBQbs/NQKNeoZmtsCnRVSiqmVuudOaEXdZWUQy9ZZRGrBQSfKcIvKQaO8lAweXPowNBuuQnbckpowQDVQpg9HIXF7rexDJ9/RqtjZ6vKGy5/ptLjueFpW//B15LOkPvF3qngv7MkvSGiQQQpNziALMQ+xoLhua6zgncTd29Gr/mC1e5qoxGMYq3scvMVtTdBo8Qs=", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..853b04e404d --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,68 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _5", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "EXPR [ (-1, _0) 0 ]", + "EXPR [ (10, _0) (-1, _3) 0 ]", + "INIT (id: 0, len: 1, witnesses: [_3])", + "EXPR [ (-1, _4) 0 ]", + "MEM (id: 0, read at: EXPR [ (1, _4) 0 ], value: EXPR [ (1, _5) 0 ]) ", + "EXPR [ (1, _0) (1, _1) -1 ]", + "EXPR [ (2, _0) (1, _2) -2 ]" + ], + "debug_symbols": "nZHdCoMwDIXfJde98HdTX2UMqRqlUNpS28EQ332x2E0vBmM3SZOTr4GTBQbs/NQKNeoZmtsCnRVSiqmVuudOaEXdZWUQy9ZZRGrBQSfKcIvKQaO8lAweXPowNBuuQnbckpowQDVQpg9HIXF7rexDJ9/RqtjZ6vKGy5/ptLjueFpW//B15LOkPvF3qngv7MkvSGiQQQpNziALMQ+xoLhua6zgncTd29Gr/mC1e5qoxGMYq3scvMVtTdBo8Qs=", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..590d58eea10 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,74 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _2", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: [_1, _2]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32839 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U1) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 15 }, Call { location: 16 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, Stop { return_data: HeapVector { pointer: Relative(3), size: Relative(4) } }, Return, Call { location: 90 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(3), rhs: Relative(5) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(4) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 10 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(5), rhs: Relative(7) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(6) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Relative(6) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, Not { destination: Relative(3), source: Relative(1), bit_size: U1 }, Load { destination: Relative(5), source_pointer: Relative(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(7), op: Equals, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, Not { destination: Relative(7), source: Relative(7), bit_size: U1 }, JumpIf { condition: Relative(7), location: 51 }, Call { location: 96 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(5) }, Cast { destination: Relative(5), source: Relative(1), bit_size: Integer(U32) }, ConditionalMov { destination: Relative(8), source_a: Relative(4), source_b: Relative(2), condition: Relative(1) }, Mov { destination: Direct(32771), source: Relative(8) }, Call { location: 99 }, Mov { destination: Relative(7), source: Direct(32772) }, Const { destination: Relative(2), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(1), location: 86 }, Jump { location: 61 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(3), source: Relative(4) }, Jump { location: 64 }, JumpIf { condition: Relative(1), location: 69 }, Jump { location: 66 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 2 }, Mov { destination: Relative(4), source: Relative(1) }, Jump { location: 83 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: LessThan, bit_size: U32, lhs: Relative(1), rhs: Relative(5) }, JumpIf { condition: Relative(6), location: 73 }, Call { location: 125 }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Const { destination: Relative(9), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(9) }, Load { destination: Relative(2), source_pointer: Relative(8) }, Mov { destination: Direct(32771), source: Relative(7) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 128 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(4), source: Relative(2) }, Jump { location: 83 }, Mov { destination: Relative(1), source: Relative(3) }, Mov { destination: Relative(2), source: Relative(4) }, Return, Const { destination: Relative(1), bit_size: Integer(U1), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U1, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 90 }, Call { location: 125 }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 95 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32773), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32774), op: Equals, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, JumpIf { condition: Direct(32774), location: 103 }, Jump { location: 105 }, Mov { destination: Direct(32772), source: Direct(32771) }, Jump { location: 124 }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32776) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32775), rhs: Direct(32776) }, Mov { destination: Direct(32772), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32775) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32775) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 122 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 115 }, IndirectConst { destination_pointer: Direct(32772), bit_size: Integer(U32), value: 1 }, Jump { location: 124 }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32778), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32779), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32779), location: 138 }, Jump { location: 146 }, BinaryIntOp { destination: Direct(32773), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 169 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32781) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32780) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(32781) }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32778) }, Mov { destination: Direct(32784), source: Direct(32781) }, Mov { destination: Direct(32785), source: Direct(32780) }, BinaryIntOp { destination: Direct(32786), op: Equals, bit_size: U32, lhs: Direct(32784), rhs: Direct(32783) }, JumpIf { condition: Direct(32786), location: 168 }, Load { destination: Direct(32782), source_pointer: Direct(32784) }, Store { destination_pointer: Direct(32785), source: Direct(32782) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, Jump { location: 161 }, Jump { location: 169 }, Return]" + ], + "debug_symbols": "nZLRioMwEEX/Jc95SHSiSX9lKSW1aQmEKKkuLMV/30lv3W0fFpa+eBwn5yrj3MQpHJfLIebzeBW7j5s4lphSvBzSOPg5jpmf3oSql8aJnZaiVYAGGqAFCDBAB/SABZBCSCGkEFIIKQSdoBN0gk7QDXQD3UA3eLuBbqAb6B17jRS9AjTQAC1AgAE6oAcsgBSLFMtHWkYPWICPtOsqxTbAw1xCqPN7mijPefIl5Fns8pKSFJ8+LfdD18nnO2dfuKukCPnE5MBzTKHerfLXVn+rlh6u7X5k829bu/6hN8q949Pma2Nf/D1XfojlZcPWmlSiP6bwKM9LHp6689e0dbYNnco4hNNSQk16WlMer3NSN7Tn386FbqzUneNKq9pT0pla6Fp00tn9Wr/qGw==", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..590d58eea10 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,74 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _2", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: [_1, _2]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32839 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U1) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 15 }, Call { location: 16 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, Stop { return_data: HeapVector { pointer: Relative(3), size: Relative(4) } }, Return, Call { location: 90 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(3), rhs: Relative(5) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(4) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 10 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(5), rhs: Relative(7) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(6) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Relative(6) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, Not { destination: Relative(3), source: Relative(1), bit_size: U1 }, Load { destination: Relative(5), source_pointer: Relative(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(7), op: Equals, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, Not { destination: Relative(7), source: Relative(7), bit_size: U1 }, JumpIf { condition: Relative(7), location: 51 }, Call { location: 96 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(5) }, Cast { destination: Relative(5), source: Relative(1), bit_size: Integer(U32) }, ConditionalMov { destination: Relative(8), source_a: Relative(4), source_b: Relative(2), condition: Relative(1) }, Mov { destination: Direct(32771), source: Relative(8) }, Call { location: 99 }, Mov { destination: Relative(7), source: Direct(32772) }, Const { destination: Relative(2), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(1), location: 86 }, Jump { location: 61 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(3), source: Relative(4) }, Jump { location: 64 }, JumpIf { condition: Relative(1), location: 69 }, Jump { location: 66 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 2 }, Mov { destination: Relative(4), source: Relative(1) }, Jump { location: 83 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: LessThan, bit_size: U32, lhs: Relative(1), rhs: Relative(5) }, JumpIf { condition: Relative(6), location: 73 }, Call { location: 125 }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Const { destination: Relative(9), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(9) }, Load { destination: Relative(2), source_pointer: Relative(8) }, Mov { destination: Direct(32771), source: Relative(7) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 128 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(4), source: Relative(2) }, Jump { location: 83 }, Mov { destination: Relative(1), source: Relative(3) }, Mov { destination: Relative(2), source: Relative(4) }, Return, Const { destination: Relative(1), bit_size: Integer(U1), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U1, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 90 }, Call { location: 125 }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 95 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32773), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32774), op: Equals, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, JumpIf { condition: Direct(32774), location: 103 }, Jump { location: 105 }, Mov { destination: Direct(32772), source: Direct(32771) }, Jump { location: 124 }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32776) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32775), rhs: Direct(32776) }, Mov { destination: Direct(32772), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32775) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32775) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 122 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 115 }, IndirectConst { destination_pointer: Direct(32772), bit_size: Integer(U32), value: 1 }, Jump { location: 124 }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32778), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32779), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32779), location: 138 }, Jump { location: 146 }, BinaryIntOp { destination: Direct(32773), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 169 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32781) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32780) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(32781) }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32778) }, Mov { destination: Direct(32784), source: Direct(32781) }, Mov { destination: Direct(32785), source: Direct(32780) }, BinaryIntOp { destination: Direct(32786), op: Equals, bit_size: U32, lhs: Direct(32784), rhs: Direct(32783) }, JumpIf { condition: Direct(32786), location: 168 }, Load { destination: Direct(32782), source_pointer: Direct(32784) }, Store { destination_pointer: Direct(32785), source: Direct(32782) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, Jump { location: 161 }, Jump { location: 169 }, Return]" + ], + "debug_symbols": "nZLRioMwEEX/Jc95SHSiSX9lKSW1aQmEKKkuLMV/30lv3W0fFpa+eBwn5yrj3MQpHJfLIebzeBW7j5s4lphSvBzSOPg5jpmf3oSql8aJnZaiVYAGGqAFCDBAB/SABZBCSCGkEFIIKQSdoBN0gk7QDXQD3UA3eLuBbqAb6B17jRS9AjTQAC1AgAE6oAcsgBSLFMtHWkYPWICPtOsqxTbAw1xCqPN7mijPefIl5Fns8pKSFJ8+LfdD18nnO2dfuKukCPnE5MBzTKHerfLXVn+rlh6u7X5k829bu/6hN8q949Pma2Nf/D1XfojlZcPWmlSiP6bwKM9LHp6689e0dbYNnco4hNNSQk16WlMer3NSN7Tn386FbqzUneNKq9pT0pla6Fp00tn9Wr/qGw==", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..590d58eea10 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,74 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "b", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + }, + "visibility": "public" + }, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _2", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2]", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: [_1, _2]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32839 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U1) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 15 }, Call { location: 16 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, Stop { return_data: HeapVector { pointer: Relative(3), size: Relative(4) } }, Return, Call { location: 90 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(3), rhs: Relative(5) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(4) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(3) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 10 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(5), rhs: Relative(7) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(6) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, BinaryIntOp { destination: Relative(6), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(6), source: Relative(5) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Relative(6) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, Not { destination: Relative(3), source: Relative(1), bit_size: U1 }, Load { destination: Relative(5), source_pointer: Relative(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(7), op: Equals, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, Not { destination: Relative(7), source: Relative(7), bit_size: U1 }, JumpIf { condition: Relative(7), location: 51 }, Call { location: 96 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(5) }, Cast { destination: Relative(5), source: Relative(1), bit_size: Integer(U32) }, ConditionalMov { destination: Relative(8), source_a: Relative(4), source_b: Relative(2), condition: Relative(1) }, Mov { destination: Direct(32771), source: Relative(8) }, Call { location: 99 }, Mov { destination: Relative(7), source: Direct(32772) }, Const { destination: Relative(2), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(1), location: 86 }, Jump { location: 61 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(3), source: Relative(4) }, Jump { location: 64 }, JumpIf { condition: Relative(1), location: 69 }, Jump { location: 66 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 2 }, Mov { destination: Relative(4), source: Relative(1) }, Jump { location: 83 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: LessThan, bit_size: U32, lhs: Relative(1), rhs: Relative(5) }, JumpIf { condition: Relative(6), location: 73 }, Call { location: 125 }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Const { destination: Relative(9), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(9) }, Load { destination: Relative(2), source_pointer: Relative(8) }, Mov { destination: Direct(32771), source: Relative(7) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 128 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(4), source: Relative(2) }, Jump { location: 83 }, Mov { destination: Relative(1), source: Relative(3) }, Mov { destination: Relative(2), source: Relative(4) }, Return, Const { destination: Relative(1), bit_size: Integer(U1), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U1, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 90 }, Call { location: 125 }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 95 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32773), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32774), op: Equals, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, JumpIf { condition: Direct(32774), location: 103 }, Jump { location: 105 }, Mov { destination: Direct(32772), source: Direct(32771) }, Jump { location: 124 }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32776) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, Const { destination: Direct(32776), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32775), rhs: Direct(32776) }, Mov { destination: Direct(32772), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32775) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32775) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 122 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 115 }, IndirectConst { destination_pointer: Direct(32772), bit_size: Integer(U32), value: 1 }, Jump { location: 124 }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32778), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32779), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32779), location: 138 }, Jump { location: 146 }, BinaryIntOp { destination: Direct(32773), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 169 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32781) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32780) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32778) }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(32781) }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32778) }, Mov { destination: Direct(32784), source: Direct(32781) }, Mov { destination: Direct(32785), source: Direct(32780) }, BinaryIntOp { destination: Direct(32786), op: Equals, bit_size: U32, lhs: Direct(32784), rhs: Direct(32783) }, JumpIf { condition: Direct(32786), location: 168 }, Load { destination: Direct(32782), source_pointer: Direct(32784) }, Store { destination_pointer: Direct(32785), source: Direct(32782) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, Jump { location: 161 }, Jump { location: 169 }, Return]" + ], + "debug_symbols": "nZLRioMwEEX/Jc95SHSiSX9lKSW1aQmEKKkuLMV/30lv3W0fFpa+eBwn5yrj3MQpHJfLIebzeBW7j5s4lphSvBzSOPg5jpmf3oSql8aJnZaiVYAGGqAFCDBAB/SABZBCSCGkEFIIKQSdoBN0gk7QDXQD3UA3eLuBbqAb6B17jRS9AjTQAC1AgAE6oAcsgBSLFMtHWkYPWICPtOsqxTbAw1xCqPN7mijPefIl5Fns8pKSFJ8+LfdD18nnO2dfuKukCPnE5MBzTKHerfLXVn+rlh6u7X5k829bu/6hN8q949Pma2Nf/D1XfojlZcPWmlSiP6bwKM9LHp6689e0dbYNnco4hNNSQk16WlMer3NSN7Tn386FbqzUneNKq9pT0pla6Fp00tn9Wr/qGw==", + "file_map": { + "50": { + "source": "fn main(b: bool) -> pub (u32, u32) {\n let s0: [u32] = &[];\n let s1: [u32] = &[10];\n let s2 = if b { s1 } else { s0 };\n let i1 = if b { s0.pop_back().1 } else { 1 };\n let i2 = if b { s2.pop_front().0 } else { 2 };\n (i1, i2)\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__stdout.snap new file mode 100644 index 00000000000..9ab7cdfda4c --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9467/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- +[regression_9467] Circuit output: (1, 2)