diff --git a/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs b/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs index 46e1c487232..532c96dae6d 100644 --- a/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs +++ b/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs @@ -510,6 +510,9 @@ impl Interpreter<'_, W> { let mut new_elements = slice.elements.borrow().to_vec(); let element_types = slice.element_types.clone(); + // The slice might contain more elements than its length. + // We need to either insert before the extras, overwrite, or remove them. + new_elements.truncate(element_types.len() * length as usize); for arg in args.iter().skip(2) { new_elements.push(self.lookup(*arg)?); } @@ -548,6 +551,10 @@ impl Interpreter<'_, W> { } check_slice_can_pop_all_element_types(args[1], &slice)?; + // The slice might contain more elements than its length. + // We want the last valid element, ignoring any extras following it. + // We don't ever access the extras, so we might as well remove any. + slice_elements.truncate(element_types.len() * length as usize); let mut popped_elements = vecmap(0..element_types.len(), |_| slice_elements.pop().unwrap()); popped_elements.reverse(); diff --git a/test_programs/execution_success/regression_9312/Nargo.toml b/test_programs/execution_success/regression_9312/Nargo.toml new file mode 100644 index 00000000000..a174435e1f8 --- /dev/null +++ b/test_programs/execution_success/regression_9312/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "regression_9312" +type = "bin" +authors = [""] + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/regression_9312/Prover.toml b/test_programs/execution_success/regression_9312/Prover.toml new file mode 100644 index 00000000000..f514d5f2ef7 --- /dev/null +++ b/test_programs/execution_success/regression_9312/Prover.toml @@ -0,0 +1,2 @@ +a = true +return = [[1, 20], [3, 60]] diff --git a/test_programs/execution_success/regression_9312/src/main.nr b/test_programs/execution_success/regression_9312/src/main.nr new file mode 100644 index 00000000000..9eec6cbafc3 --- /dev/null +++ b/test_programs/execution_success/regression_9312/src/main.nr @@ -0,0 +1,6 @@ +fn main(a: bool) -> pub ((u32, Field), (u32, Field)) { + let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] }; + let (s1, f) = s0.pop_back(); + let s2 = s0.push_back(60); + ((s1.len(), f), (s2.len(), s2[2])) +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__expanded.snap new file mode 100644 index 00000000000..375061886db --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__expanded.snap @@ -0,0 +1,14 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main(a: bool) -> pub ((u32, Field), (u32, Field)) { + let s0: [Field] = if a { + &[10_Field, 20_Field] + } else { + &[30_Field, 40_Field, 50_Field] + }; + let (s1, f): ([Field], Field) = s0.pop_back(); + let s2: [Field] = s0.push_back(60_Field); + ((s1.len(), f), (s2.len(), s2[2_u32])) +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..c31e3e8665a --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,114 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "visibility": "public" + }, + "error_types": { + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _18", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BLACKBOX::RANGE [(_0, 1)] []", + "EXPR [ (-20, _0) (-1, _5) 30 ]", + "EXPR [ (-20, _0) (-1, _6) 40 ]", + "EXPR [ (-50, _0) (-1, _7) 50 ]", + "INIT (id: 0, len: 3, witnesses: [_5, _6, _7])", + "EXPR [ (-1, _0) (-1, _8) 2 ]", + "MEM (id: 0, read at: EXPR [ (1, _8) 0 ], value: EXPR [ (1, _9) 0 ]) ", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(10))]", + "EXPR [ (-1, _0, _10) (1, _11) -1 ]", + "EXPR [ (-1, _0, _11) 0 ]", + "EXPR [ (-1, _0) (-1, _12) 4 ]", + "BLACKBOX::RANGE [(_12, 32)] []", + "EXPR [ (-1, _13) 60 ]", + "INIT (id: 2, len: 4, witnesses: [_5, _6, _7, _13])", + "EXPR [ (-1, _0) (-1, _14) 3 ]", + "MEM (id: 2, write EXPR [ (1, _13) 0 ] at: EXPR [ (1, _14) 0 ]) ", + "EXPR [ (-1, _15) 2 ]", + "MEM (id: 2, read at: EXPR [ (1, _15) 0 ], value: EXPR [ (1, _16) 0 ]) ", + "BRILLIG CALL func 1: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(12))], q_c: 4294967298 }), Single(Expression { mul_terms: [], linear_combinations: [], q_c: 4294967296 })], outputs: [Simple(Witness(17)), Simple(Witness(18))]", + "BLACKBOX::RANGE [(_18, 32)] []", + "EXPR [ (-1, _12) (-4294967296, _17) (-1, _18) 4294967298 ]", + "EXPR [ (-1, _17) 0 ]", + "EXPR [ (1, _1) (-1, _8) 0 ]", + "EXPR [ (1, _2) (-1, _9) 0 ]", + "EXPR [ (1, _3) (-1, _12) 0 ]", + "EXPR [ (-1, _7, _11) (1, _11, _16) (1, _4) (-1, _16) 0 ]", + "unconstrained func 0", + "[Const { destination: Direct(21), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(20), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(21), offset_address: Direct(20) }, Const { destination: Direct(2), bit_size: Field, value: 0 }, BinaryFieldOp { destination: Direct(3), op: Equals, lhs: Direct(0), rhs: Direct(2) }, JumpIf { condition: Direct(3), location: 8 }, Const { destination: Direct(1), bit_size: Field, value: 1 }, BinaryFieldOp { destination: Direct(0), op: Div, lhs: Direct(1), rhs: Direct(0) }, Stop { return_data: HeapVector { pointer: Direct(20), size: Direct(21) } }]", + "unconstrained func 1", + "[Const { destination: Direct(10), bit_size: Integer(U32), value: 2 }, Const { destination: Direct(11), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(10), offset_address: Direct(11) }, BinaryFieldOp { destination: Direct(2), op: IntegerDiv, lhs: Direct(0), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Mul, lhs: Direct(2), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Sub, lhs: Direct(0), rhs: Direct(1) }, Mov { destination: Direct(0), source: Direct(2) }, Stop { return_data: HeapVector { pointer: Direct(11), size: Direct(10) } }]" + ], + "debug_symbols": "nZHBboQgEIbfZc4cBNTVfZWmMajjhoSgYaFJY3z3jsPS7h6aNL38nzB+TGB2mHFMt8H6Zb3D9W2HMVjn7G1w62SiXT3t7oeAshxiQKQteKqTtZmAPsLVJ+cEfBiX+Kf7ZjwzmkDVSgD6mUgHLtbh+XWIH7v6XZW6e8iy7r/15u9+2xb/0v3DV7L0V/K1/zutzGTDy4uBpEYCFKfmrDkbzpbzQocJ6Dh7TqkydEad0WS0GdmSpGlCz1BVBnXVx3mJYM3o8DG7JfnpaZTxcyuVMuwtrBPOKeB5Ca7Rtb4A", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "directive_invert", + "directive_integer_quotient" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..c31e3e8665a --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,114 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "visibility": "public" + }, + "error_types": { + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _18", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BLACKBOX::RANGE [(_0, 1)] []", + "EXPR [ (-20, _0) (-1, _5) 30 ]", + "EXPR [ (-20, _0) (-1, _6) 40 ]", + "EXPR [ (-50, _0) (-1, _7) 50 ]", + "INIT (id: 0, len: 3, witnesses: [_5, _6, _7])", + "EXPR [ (-1, _0) (-1, _8) 2 ]", + "MEM (id: 0, read at: EXPR [ (1, _8) 0 ], value: EXPR [ (1, _9) 0 ]) ", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(10))]", + "EXPR [ (-1, _0, _10) (1, _11) -1 ]", + "EXPR [ (-1, _0, _11) 0 ]", + "EXPR [ (-1, _0) (-1, _12) 4 ]", + "BLACKBOX::RANGE [(_12, 32)] []", + "EXPR [ (-1, _13) 60 ]", + "INIT (id: 2, len: 4, witnesses: [_5, _6, _7, _13])", + "EXPR [ (-1, _0) (-1, _14) 3 ]", + "MEM (id: 2, write EXPR [ (1, _13) 0 ] at: EXPR [ (1, _14) 0 ]) ", + "EXPR [ (-1, _15) 2 ]", + "MEM (id: 2, read at: EXPR [ (1, _15) 0 ], value: EXPR [ (1, _16) 0 ]) ", + "BRILLIG CALL func 1: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(12))], q_c: 4294967298 }), Single(Expression { mul_terms: [], linear_combinations: [], q_c: 4294967296 })], outputs: [Simple(Witness(17)), Simple(Witness(18))]", + "BLACKBOX::RANGE [(_18, 32)] []", + "EXPR [ (-1, _12) (-4294967296, _17) (-1, _18) 4294967298 ]", + "EXPR [ (-1, _17) 0 ]", + "EXPR [ (1, _1) (-1, _8) 0 ]", + "EXPR [ (1, _2) (-1, _9) 0 ]", + "EXPR [ (1, _3) (-1, _12) 0 ]", + "EXPR [ (-1, _7, _11) (1, _11, _16) (1, _4) (-1, _16) 0 ]", + "unconstrained func 0", + "[Const { destination: Direct(21), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(20), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(21), offset_address: Direct(20) }, Const { destination: Direct(2), bit_size: Field, value: 0 }, BinaryFieldOp { destination: Direct(3), op: Equals, lhs: Direct(0), rhs: Direct(2) }, JumpIf { condition: Direct(3), location: 8 }, Const { destination: Direct(1), bit_size: Field, value: 1 }, BinaryFieldOp { destination: Direct(0), op: Div, lhs: Direct(1), rhs: Direct(0) }, Stop { return_data: HeapVector { pointer: Direct(20), size: Direct(21) } }]", + "unconstrained func 1", + "[Const { destination: Direct(10), bit_size: Integer(U32), value: 2 }, Const { destination: Direct(11), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(10), offset_address: Direct(11) }, BinaryFieldOp { destination: Direct(2), op: IntegerDiv, lhs: Direct(0), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Mul, lhs: Direct(2), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Sub, lhs: Direct(0), rhs: Direct(1) }, Mov { destination: Direct(0), source: Direct(2) }, Stop { return_data: HeapVector { pointer: Direct(11), size: Direct(10) } }]" + ], + "debug_symbols": "nZHBboQgEIbfZc4cBNTVfZWmMajjhoSgYaFJY3z3jsPS7h6aNL38nzB+TGB2mHFMt8H6Zb3D9W2HMVjn7G1w62SiXT3t7oeAshxiQKQteKqTtZmAPsLVJ+cEfBiX+Kf7ZjwzmkDVSgD6mUgHLtbh+XWIH7v6XZW6e8iy7r/15u9+2xb/0v3DV7L0V/K1/zutzGTDy4uBpEYCFKfmrDkbzpbzQocJ6Dh7TqkydEad0WS0GdmSpGlCz1BVBnXVx3mJYM3o8DG7JfnpaZTxcyuVMuwtrBPOKeB5Ca7Rtb4A", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "directive_invert", + "directive_integer_quotient" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..c31e3e8665a --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,114 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "visibility": "public" + }, + "error_types": { + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + }, + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _18", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BLACKBOX::RANGE [(_0, 1)] []", + "EXPR [ (-20, _0) (-1, _5) 30 ]", + "EXPR [ (-20, _0) (-1, _6) 40 ]", + "EXPR [ (-50, _0) (-1, _7) 50 ]", + "INIT (id: 0, len: 3, witnesses: [_5, _6, _7])", + "EXPR [ (-1, _0) (-1, _8) 2 ]", + "MEM (id: 0, read at: EXPR [ (1, _8) 0 ], value: EXPR [ (1, _9) 0 ]) ", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(10))]", + "EXPR [ (-1, _0, _10) (1, _11) -1 ]", + "EXPR [ (-1, _0, _11) 0 ]", + "EXPR [ (-1, _0) (-1, _12) 4 ]", + "BLACKBOX::RANGE [(_12, 32)] []", + "EXPR [ (-1, _13) 60 ]", + "INIT (id: 2, len: 4, witnesses: [_5, _6, _7, _13])", + "EXPR [ (-1, _0) (-1, _14) 3 ]", + "MEM (id: 2, write EXPR [ (1, _13) 0 ] at: EXPR [ (1, _14) 0 ]) ", + "EXPR [ (-1, _15) 2 ]", + "MEM (id: 2, read at: EXPR [ (1, _15) 0 ], value: EXPR [ (1, _16) 0 ]) ", + "BRILLIG CALL func 1: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(-1, Witness(12))], q_c: 4294967298 }), Single(Expression { mul_terms: [], linear_combinations: [], q_c: 4294967296 })], outputs: [Simple(Witness(17)), Simple(Witness(18))]", + "BLACKBOX::RANGE [(_18, 32)] []", + "EXPR [ (-1, _12) (-4294967296, _17) (-1, _18) 4294967298 ]", + "EXPR [ (-1, _17) 0 ]", + "EXPR [ (1, _1) (-1, _8) 0 ]", + "EXPR [ (1, _2) (-1, _9) 0 ]", + "EXPR [ (1, _3) (-1, _12) 0 ]", + "EXPR [ (-1, _7, _11) (1, _11, _16) (1, _4) (-1, _16) 0 ]", + "unconstrained func 0", + "[Const { destination: Direct(21), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(20), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(21), offset_address: Direct(20) }, Const { destination: Direct(2), bit_size: Field, value: 0 }, BinaryFieldOp { destination: Direct(3), op: Equals, lhs: Direct(0), rhs: Direct(2) }, JumpIf { condition: Direct(3), location: 8 }, Const { destination: Direct(1), bit_size: Field, value: 1 }, BinaryFieldOp { destination: Direct(0), op: Div, lhs: Direct(1), rhs: Direct(0) }, Stop { return_data: HeapVector { pointer: Direct(20), size: Direct(21) } }]", + "unconstrained func 1", + "[Const { destination: Direct(10), bit_size: Integer(U32), value: 2 }, Const { destination: Direct(11), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(0), size_address: Direct(10), offset_address: Direct(11) }, BinaryFieldOp { destination: Direct(2), op: IntegerDiv, lhs: Direct(0), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Mul, lhs: Direct(2), rhs: Direct(1) }, BinaryFieldOp { destination: Direct(1), op: Sub, lhs: Direct(0), rhs: Direct(1) }, Mov { destination: Direct(0), source: Direct(2) }, Stop { return_data: HeapVector { pointer: Direct(11), size: Direct(10) } }]" + ], + "debug_symbols": "nZHBboQgEIbfZc4cBNTVfZWmMajjhoSgYaFJY3z3jsPS7h6aNL38nzB+TGB2mHFMt8H6Zb3D9W2HMVjn7G1w62SiXT3t7oeAshxiQKQteKqTtZmAPsLVJ+cEfBiX+Kf7ZjwzmkDVSgD6mUgHLtbh+XWIH7v6XZW6e8iy7r/15u9+2xb/0v3DV7L0V/K1/zutzGTDy4uBpEYCFKfmrDkbzpbzQocJ6Dh7TqkydEad0WS0GdmSpGlCz1BVBnXVx3mJYM3o8DG7JfnpaZTxcyuVMuwtrBPOKeB5Ca7Rtb4A", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "directive_invert", + "directive_integer_quotient" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..0fb88025ed2 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,90 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "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 : _4", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(1)), Simple(Witness(2)), Simple(Witness(3)), Simple(Witness(4))]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32841 }, 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: 17 }, Call { location: 18 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Mov { destination: Direct(32839), source: Relative(3) }, Mov { destination: Direct(32840), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(6), bit_size: Integer(U32), value: 4 }, Stop { return_data: HeapVector { pointer: Relative(5), size: Relative(6) } }, Return, Call { location: 109 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, JumpIf { condition: Relative(1), location: 47 }, Jump { location: 22 }, Const { destination: Relative(1), bit_size: Field, value: 30 }, Const { destination: Relative(5), bit_size: Field, value: 40 }, Const { destination: Relative(6), bit_size: Field, value: 50 }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(10), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(10) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(9) }, IndirectConst { destination_pointer: Relative(7), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(7), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, 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) }, Mov { destination: Relative(9), source: Relative(8) }, Store { destination_pointer: Relative(9), source: Relative(1) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(5) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(6) }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, Mov { destination: Relative(2), source: Relative(1) }, Mov { destination: Relative(3), source: Relative(7) }, Jump { location: 68 }, Const { destination: Relative(1), bit_size: Field, value: 10 }, Const { destination: Relative(5), bit_size: Field, value: 20 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 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) }, Mov { destination: Relative(6), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(8) }, IndirectConst { destination_pointer: Relative(6), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Relative(8) }, Mov { destination: Relative(8), source: Relative(7) }, Store { destination_pointer: Relative(8), source: Relative(1) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(5) }, Mov { destination: Relative(2), source: Relative(4) }, Mov { destination: Relative(3), source: Relative(6) }, Jump { location: 68 }, Load { destination: Relative(1), source_pointer: Relative(3) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: Equals, bit_size: U32, lhs: Relative(5), rhs: Relative(1) }, Not { destination: Relative(6), source: Relative(6), bit_size: U1 }, JumpIf { condition: Relative(6), location: 74 }, Call { location: 115 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(3), source: Relative(1) }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 118 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(8), source: Direct(32774) }, Load { destination: Relative(7), source_pointer: Relative(8) }, Const { destination: Relative(8), bit_size: Field, value: 60 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 155 }, Mov { destination: Relative(10), source: Direct(32773) }, Mov { destination: Relative(11), source: Direct(32774) }, Store { destination_pointer: Relative(11), source: Relative(8) }, Load { destination: Relative(2), source_pointer: Relative(10) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(8), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(2) }, Not { destination: Relative(8), source: Relative(8), bit_size: U1 }, JumpIf { condition: Relative(8), location: 97 }, Call { location: 115 }, BinaryIntOp { destination: Relative(2), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(10), source: Relative(2) }, BinaryIntOp { destination: Relative(2), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Relative(9) }, Const { destination: Relative(4), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(2), location: 103 }, Call { location: 211 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 5 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(10), rhs: Relative(2) }, Load { destination: Relative(4), source_pointer: Relative(8) }, Mov { destination: Relative(2), source: Relative(7) }, Mov { destination: Relative(3), source: Relative(9) }, Return, 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: 114 }, 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, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, Load { destination: Direct(32777), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Equals, bit_size: U32, lhs: Direct(32777), rhs: Direct(2) }, Const { destination: Direct(32780), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32780) }, JumpIf { condition: Direct(32778), location: 127 }, Jump { location: 131 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 153 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32776), 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(32776) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, 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(32782), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Mov { destination: Direct(32783), source: Direct(32779) }, Mov { destination: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32785), op: Equals, bit_size: U32, lhs: Direct(32783), rhs: Direct(32782) }, JumpIf { condition: Direct(32785), location: 152 }, Load { destination: Direct(32781), source_pointer: Direct(32783) }, Store { destination_pointer: Direct(32784), source: Direct(32781) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Jump { location: 145 }, Jump { location: 153 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Return, Load { destination: Direct(32775), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Load { destination: Direct(32777), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: LessThanEquals, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, BinaryIntOp { destination: Direct(32781), op: Equals, bit_size: U32, lhs: Direct(32775), rhs: Direct(2) }, JumpIf { condition: Direct(32780), location: 166 }, Jump { location: 183 }, JumpIf { condition: Direct(32781), location: 168 }, Jump { location: 172 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, Jump { location: 182 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32783) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32782) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32777) }, Jump { location: 182 }, Jump { location: 195 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32782), op: Mul, bit_size: U32, lhs: Direct(32779), rhs: Direct(32783) }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(32784) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32779) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32782) }, Jump { location: 195 }, 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: Equals, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, JumpIf { condition: Direct(32781), location: 209 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32776) }, Mov { destination: Direct(32784), source: Direct(32778) }, 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: 209 }, 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: 202 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(32776) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "nZTbioMwEIbfJddeZHI0fZWlFGvTIoiK1YWl+O478Tc9XCws3vTrGP8vExjzEJd4nm+nprv2d3H4eojz2LRtczu1fV1NTd/x04eQ6UcpcaBCKA0YwAIO8EAJhBVaAgTAomHRsGhYNCwaFg2LhsXAYmAxsBh+UzFKIKywEiBAARowgAUcAIuFxcLiYHGwOFgcLA4WhwYdGvRo0KNBjwY9julxTI9jet5WMzxQAmFFKQECFMAWwzCABRzggRIIK4IE2GIZCtCAASzgAA+UAFtcIUjKjbRRbWSTTzQb2eWXpRB5aE7TGGOambcp4tkaqjF2kzh0c9sW4rtq5/Wl+1B1K6dq5FVZiNhdmCy8Nm1M/5bilZZ/R4n0Fiayz7j9dz7kvYPakSZd5t1N2JN3Lud9uSf/bJ+C25FXlPtXFHblbc4r+ZE/clXVzfhxqyzJNDbVuY1beZ27+m11+hnySr6VhrGv42UeYzK9riaewy+ytlAkj/wppYrPQtYc03SmUoaCaC1pXbVc+uOSWvsF", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..0fb88025ed2 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,90 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "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 : _4", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(1)), Simple(Witness(2)), Simple(Witness(3)), Simple(Witness(4))]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32841 }, 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: 17 }, Call { location: 18 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Mov { destination: Direct(32839), source: Relative(3) }, Mov { destination: Direct(32840), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(6), bit_size: Integer(U32), value: 4 }, Stop { return_data: HeapVector { pointer: Relative(5), size: Relative(6) } }, Return, Call { location: 109 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, JumpIf { condition: Relative(1), location: 47 }, Jump { location: 22 }, Const { destination: Relative(1), bit_size: Field, value: 30 }, Const { destination: Relative(5), bit_size: Field, value: 40 }, Const { destination: Relative(6), bit_size: Field, value: 50 }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(10), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(10) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(9) }, IndirectConst { destination_pointer: Relative(7), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(7), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, 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) }, Mov { destination: Relative(9), source: Relative(8) }, Store { destination_pointer: Relative(9), source: Relative(1) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(5) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(6) }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, Mov { destination: Relative(2), source: Relative(1) }, Mov { destination: Relative(3), source: Relative(7) }, Jump { location: 68 }, Const { destination: Relative(1), bit_size: Field, value: 10 }, Const { destination: Relative(5), bit_size: Field, value: 20 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 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) }, Mov { destination: Relative(6), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(8) }, IndirectConst { destination_pointer: Relative(6), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Relative(8) }, Mov { destination: Relative(8), source: Relative(7) }, Store { destination_pointer: Relative(8), source: Relative(1) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(5) }, Mov { destination: Relative(2), source: Relative(4) }, Mov { destination: Relative(3), source: Relative(6) }, Jump { location: 68 }, Load { destination: Relative(1), source_pointer: Relative(3) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: Equals, bit_size: U32, lhs: Relative(5), rhs: Relative(1) }, Not { destination: Relative(6), source: Relative(6), bit_size: U1 }, JumpIf { condition: Relative(6), location: 74 }, Call { location: 115 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(3), source: Relative(1) }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 118 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(8), source: Direct(32774) }, Load { destination: Relative(7), source_pointer: Relative(8) }, Const { destination: Relative(8), bit_size: Field, value: 60 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 155 }, Mov { destination: Relative(10), source: Direct(32773) }, Mov { destination: Relative(11), source: Direct(32774) }, Store { destination_pointer: Relative(11), source: Relative(8) }, Load { destination: Relative(2), source_pointer: Relative(10) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(8), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(2) }, Not { destination: Relative(8), source: Relative(8), bit_size: U1 }, JumpIf { condition: Relative(8), location: 97 }, Call { location: 115 }, BinaryIntOp { destination: Relative(2), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(10), source: Relative(2) }, BinaryIntOp { destination: Relative(2), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Relative(9) }, Const { destination: Relative(4), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(2), location: 103 }, Call { location: 211 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 5 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(10), rhs: Relative(2) }, Load { destination: Relative(4), source_pointer: Relative(8) }, Mov { destination: Relative(2), source: Relative(7) }, Mov { destination: Relative(3), source: Relative(9) }, Return, 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: 114 }, 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, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, Load { destination: Direct(32777), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Equals, bit_size: U32, lhs: Direct(32777), rhs: Direct(2) }, Const { destination: Direct(32780), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32780) }, JumpIf { condition: Direct(32778), location: 127 }, Jump { location: 131 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 153 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32776), 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(32776) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, 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(32782), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Mov { destination: Direct(32783), source: Direct(32779) }, Mov { destination: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32785), op: Equals, bit_size: U32, lhs: Direct(32783), rhs: Direct(32782) }, JumpIf { condition: Direct(32785), location: 152 }, Load { destination: Direct(32781), source_pointer: Direct(32783) }, Store { destination_pointer: Direct(32784), source: Direct(32781) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Jump { location: 145 }, Jump { location: 153 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Return, Load { destination: Direct(32775), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Load { destination: Direct(32777), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: LessThanEquals, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, BinaryIntOp { destination: Direct(32781), op: Equals, bit_size: U32, lhs: Direct(32775), rhs: Direct(2) }, JumpIf { condition: Direct(32780), location: 166 }, Jump { location: 183 }, JumpIf { condition: Direct(32781), location: 168 }, Jump { location: 172 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, Jump { location: 182 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32783) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32782) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32777) }, Jump { location: 182 }, Jump { location: 195 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32782), op: Mul, bit_size: U32, lhs: Direct(32779), rhs: Direct(32783) }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(32784) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32779) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32782) }, Jump { location: 195 }, 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: Equals, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, JumpIf { condition: Direct(32781), location: 209 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32776) }, Mov { destination: Direct(32784), source: Direct(32778) }, 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: 209 }, 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: 202 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(32776) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "nZTbioMwEIbfJddeZHI0fZWlFGvTIoiK1YWl+O478Tc9XCws3vTrGP8vExjzEJd4nm+nprv2d3H4eojz2LRtczu1fV1NTd/x04eQ6UcpcaBCKA0YwAIO8EAJhBVaAgTAomHRsGhYNCwaFg2LhsXAYmAxsBh+UzFKIKywEiBAARowgAUcAIuFxcLiYHGwOFgcLA4WhwYdGvRo0KNBjwY9julxTI9jet5WMzxQAmFFKQECFMAWwzCABRzggRIIK4IE2GIZCtCAASzgAA+UAFtcIUjKjbRRbWSTTzQb2eWXpRB5aE7TGGOambcp4tkaqjF2kzh0c9sW4rtq5/Wl+1B1K6dq5FVZiNhdmCy8Nm1M/5bilZZ/R4n0Fiayz7j9dz7kvYPakSZd5t1N2JN3Lud9uSf/bJ+C25FXlPtXFHblbc4r+ZE/clXVzfhxqyzJNDbVuY1beZ27+m11+hnySr6VhrGv42UeYzK9riaewy+ytlAkj/wppYrPQtYc03SmUoaCaC1pXbVc+uOSWvsF", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..0fb88025ed2 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,90 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "tuple", + "fields": [ + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + }, + { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "field" + } + ] + } + ] + }, + "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 : _4", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : [_1, _2, _3, _4]", + "BRILLIG CALL func 0: inputs: [Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })], outputs: [Simple(Witness(1)), Simple(Witness(2)), Simple(Witness(3)), Simple(Witness(4))]", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32841 }, 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: 17 }, Call { location: 18 }, Mov { destination: Direct(32837), source: Relative(1) }, Mov { destination: Direct(32838), source: Relative(2) }, Mov { destination: Direct(32839), source: Relative(3) }, Mov { destination: Direct(32840), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(6), bit_size: Integer(U32), value: 4 }, Stop { return_data: HeapVector { pointer: Relative(5), size: Relative(6) } }, Return, Call { location: 109 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 2 }, JumpIf { condition: Relative(1), location: 47 }, Jump { location: 22 }, Const { destination: Relative(1), bit_size: Field, value: 30 }, Const { destination: Relative(5), bit_size: Field, value: 40 }, Const { destination: Relative(6), bit_size: Field, value: 50 }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(10), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(10) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(9) }, IndirectConst { destination_pointer: Relative(7), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(7), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(8) }, 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) }, Mov { destination: Relative(9), source: Relative(8) }, Store { destination_pointer: Relative(9), source: Relative(1) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(5) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(6) }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, Mov { destination: Relative(2), source: Relative(1) }, Mov { destination: Relative(3), source: Relative(7) }, Jump { location: 68 }, Const { destination: Relative(1), bit_size: Field, value: 10 }, Const { destination: Relative(5), bit_size: Field, value: 20 }, Const { destination: Relative(7), bit_size: Integer(U32), value: 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) }, Mov { destination: Relative(6), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(8) }, IndirectConst { destination_pointer: Relative(6), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(7) }, Const { destination: Relative(8), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Relative(8) }, Mov { destination: Relative(8), source: Relative(7) }, Store { destination_pointer: Relative(8), source: Relative(1) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Store { destination_pointer: Relative(8), source: Relative(5) }, Mov { destination: Relative(2), source: Relative(4) }, Mov { destination: Relative(3), source: Relative(6) }, Jump { location: 68 }, Load { destination: Relative(1), source_pointer: Relative(3) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(6), op: Equals, bit_size: U32, lhs: Relative(5), rhs: Relative(1) }, Not { destination: Relative(6), source: Relative(6), bit_size: U1 }, JumpIf { condition: Relative(6), location: 74 }, Call { location: 115 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(3), source: Relative(1) }, BinaryIntOp { destination: Relative(1), op: Sub, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 118 }, Mov { destination: Relative(6), source: Direct(32773) }, Mov { destination: Relative(8), source: Direct(32774) }, Load { destination: Relative(7), source_pointer: Relative(8) }, Const { destination: Relative(8), bit_size: Field, value: 60 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(3) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 1 }, Call { location: 155 }, Mov { destination: Relative(10), source: Direct(32773) }, Mov { destination: Relative(11), source: Direct(32774) }, Store { destination_pointer: Relative(11), source: Relative(8) }, Load { destination: Relative(2), source_pointer: Relative(10) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(8), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(2) }, Not { destination: Relative(8), source: Relative(8), bit_size: U1 }, JumpIf { condition: Relative(8), location: 97 }, Call { location: 115 }, BinaryIntOp { destination: Relative(2), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Store { destination_pointer: Relative(10), source: Relative(2) }, BinaryIntOp { destination: Relative(2), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Relative(9) }, Const { destination: Relative(4), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(2), location: 103 }, Call { location: 211 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 5 }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(10), rhs: Relative(2) }, Load { destination: Relative(4), source_pointer: Relative(8) }, Mov { destination: Relative(2), source: Relative(7) }, Mov { destination: Relative(3), source: Relative(9) }, Return, 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: 114 }, 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, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32775), source_pointer: Direct(32775) }, BinaryIntOp { destination: Direct(32776), op: Sub, bit_size: U32, lhs: Direct(32775), rhs: Direct(32772) }, Load { destination: Direct(32777), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32778), op: Equals, bit_size: U32, lhs: Direct(32777), rhs: Direct(2) }, Const { destination: Direct(32780), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32780) }, JumpIf { condition: Direct(32778), location: 127 }, Jump { location: 131 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, Jump { location: 153 }, Const { destination: Direct(32781), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32776), 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(32776) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Store { destination_pointer: Direct(32780), source: Direct(32776) }, 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(32782), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Mov { destination: Direct(32783), source: Direct(32779) }, Mov { destination: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32785), op: Equals, bit_size: U32, lhs: Direct(32783), rhs: Direct(32782) }, JumpIf { condition: Direct(32785), location: 152 }, Load { destination: Direct(32781), source_pointer: Direct(32783) }, Store { destination_pointer: Direct(32784), source: Direct(32781) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Jump { location: 145 }, Jump { location: 153 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32776) }, Return, Load { destination: Direct(32775), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(2) }, Load { destination: Direct(32776), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Load { destination: Direct(32777), source_pointer: Direct(32779) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32776), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: LessThanEquals, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, BinaryIntOp { destination: Direct(32781), op: Equals, bit_size: U32, lhs: Direct(32775), rhs: Direct(2) }, JumpIf { condition: Direct(32780), location: 166 }, Jump { location: 183 }, JumpIf { condition: Direct(32781), location: 168 }, Jump { location: 172 }, Mov { destination: Direct(32773), source: Direct(32771) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, Jump { location: 182 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32783) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32782) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32779) }, BinaryIntOp { destination: Direct(32782), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(2) }, Store { destination_pointer: Direct(32782), source: Direct(32777) }, Jump { location: 182 }, Jump { location: 195 }, Const { destination: Direct(32783), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32782), op: Mul, bit_size: U32, lhs: Direct(32779), rhs: Direct(32783) }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32782), rhs: Direct(32784) }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32773), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32779) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32782) }, Jump { location: 195 }, 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: Equals, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, JumpIf { condition: Direct(32781), location: 209 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32776) }, Mov { destination: Direct(32784), source: Direct(32778) }, 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: 209 }, 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: 202 }, BinaryIntOp { destination: Direct(32774), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(32776) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "nZTbioMwEIbfJddeZHI0fZWlFGvTIoiK1YWl+O478Tc9XCws3vTrGP8vExjzEJd4nm+nprv2d3H4eojz2LRtczu1fV1NTd/x04eQ6UcpcaBCKA0YwAIO8EAJhBVaAgTAomHRsGhYNCwaFg2LhsXAYmAxsBh+UzFKIKywEiBAARowgAUcAIuFxcLiYHGwOFgcLA4WhwYdGvRo0KNBjwY9julxTI9jet5WMzxQAmFFKQECFMAWwzCABRzggRIIK4IE2GIZCtCAASzgAA+UAFtcIUjKjbRRbWSTTzQb2eWXpRB5aE7TGGOambcp4tkaqjF2kzh0c9sW4rtq5/Wl+1B1K6dq5FVZiNhdmCy8Nm1M/5bilZZ/R4n0Fiayz7j9dz7kvYPakSZd5t1N2JN3Lud9uSf/bJ+C25FXlPtXFHblbc4r+ZE/clXVzfhxqyzJNDbVuY1beZ27+m11+hnySr6VhrGv42UeYzK9riaewy+ytlAkj/wppYrPQtYc03SmUoaCaC1pXbVc+uOSWvsF", + "file_map": { + "50": { + "source": "fn main(a: bool) -> pub ((u32, Field), (u32, Field)) {\n let s0: [Field] = if a { &[10, 20] } else { &[30, 40, 50] };\n let (s1, f) = s0.pop_back();\n let s2 = s0.push_back(60);\n ((s1.len(), f), (s2.len(), s2[2]))\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__stdout.snap new file mode 100644 index 00000000000..0927c6b5d15 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9312/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- +[regression_9312] Circuit output: Vec([Vec([Field(1), Field(20)]), Vec([Field(3), Field(60)])])