diff --git a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs index 8bf161ae7b8..e41ca5d1731 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs @@ -1723,6 +1723,33 @@ mod tests { assert_ssa_does_not_change(src, Ssa::mem2reg); } + #[test] + fn store_to_reference_from_array_get_is_not_lost() { + // `store Field 9 at v7` was incorrectly removed because of a bug + let src = " + brillig(inline) fn main f0 { + b0(v0: u1): + v2 = allocate -> &mut Field + store Field 0 at v2 + jmpif v0 then: b1, else: b2 + b1(): + v5 = make_array [v2] : [&mut Field; 1] + jmp b3(v5) + b2(): + v4 = make_array [v2] : [&mut Field; 1] + jmp b3(v4) + b3(v1: [&mut Field; 1]): + v7 = array_get v1, index u32 0 -> &mut Field + store Field 9 at v7 + v9 = array_get v1, index u32 0 -> &mut Field + v10 = load v9 -> Field + constrain v10 == Field 9 + return + } + "; + assert_ssa_does_not_change(src, Ssa::mem2reg); + } + #[test] fn aliases_block_parameter_to_its_argument() { // Here: diff --git a/test_programs/compile_success_empty/regression_9398/Nargo.toml b/test_programs/compile_success_empty/regression_9398/Nargo.toml new file mode 100644 index 00000000000..bdc0e70e0d1 --- /dev/null +++ b/test_programs/compile_success_empty/regression_9398/Nargo.toml @@ -0,0 +1,8 @@ +[package] +name = "regression_9398" +type = "bin" +authors = [""] +compiler_unstable_features = ["enums"] + + +[dependencies] diff --git a/test_programs/compile_success_empty/regression_9398/src/main.nr b/test_programs/compile_success_empty/regression_9398/src/main.nr new file mode 100644 index 00000000000..c5337a04dd0 --- /dev/null +++ b/test_programs/compile_success_empty/regression_9398/src/main.nr @@ -0,0 +1,13 @@ +fn main() { + let string = &mut "OOPS"; + let param = [string]; + assert_eq(*param[0], "OOPS"); + foo(param); + assert_eq(*param[0], "GOOD"); +} + +fn foo(param: [&mut str<4>; 1]) { + let s = param[0]; + *s = "GOOD"; + for _ in 0..1 {} +} diff --git a/test_programs/execution_success/regression_9415/Nargo.toml b/test_programs/execution_success/regression_9415/Nargo.toml new file mode 100644 index 00000000000..e61ea934c18 --- /dev/null +++ b/test_programs/execution_success/regression_9415/Nargo.toml @@ -0,0 +1,8 @@ +[package] +name = "regression_9415" +type = "bin" +authors = [""] +compiler_unstable_features = ["enums"] + + +[dependencies] diff --git a/test_programs/execution_success/regression_9415/Prover.toml b/test_programs/execution_success/regression_9415/Prover.toml new file mode 100644 index 00000000000..3dc984b8d6d --- /dev/null +++ b/test_programs/execution_success/regression_9415/Prover.toml @@ -0,0 +1 @@ +index = 0 diff --git a/test_programs/execution_success/regression_9415/src/main.nr b/test_programs/execution_success/regression_9415/src/main.nr new file mode 100644 index 00000000000..1352ecbd9f4 --- /dev/null +++ b/test_programs/execution_success/regression_9415/src/main.nr @@ -0,0 +1,8 @@ +unconstrained fn main(index: u32) { + let v0 = &mut 1; + let v1 = &mut 2; + let mut v3 = [v0]; + v3[index] = v1; + *v3[index] = 3; + assert_eq(*v3[index], 3); +} diff --git a/test_programs/execution_success/regression_9439/Nargo.toml b/test_programs/execution_success/regression_9439/Nargo.toml new file mode 100644 index 00000000000..d5075ad94fe --- /dev/null +++ b/test_programs/execution_success/regression_9439/Nargo.toml @@ -0,0 +1,8 @@ +[package] +name = "regression_9439" +type = "bin" +authors = [""] +compiler_unstable_features = ["enums"] + + +[dependencies] diff --git a/test_programs/execution_success/regression_9439/Prover.toml b/test_programs/execution_success/regression_9439/Prover.toml new file mode 100644 index 00000000000..4a3f3148a65 --- /dev/null +++ b/test_programs/execution_success/regression_9439/Prover.toml @@ -0,0 +1 @@ +n = 1 diff --git a/test_programs/execution_success/regression_9439/src/main.nr b/test_programs/execution_success/regression_9439/src/main.nr new file mode 100644 index 00000000000..ac84380c573 --- /dev/null +++ b/test_programs/execution_success/regression_9439/src/main.nr @@ -0,0 +1,10 @@ +unconstrained fn main(n: u32) { + let num1 = &mut 0; + let mut slice = &[]; + for _ in 0..n { + slice = slice.push_back(num1); + } + *slice[0] = 9; + assert_eq(*slice[0], 9); + assert_eq(*num1, 9); +} diff --git a/test_programs/execution_success/regression_9455/Nargo.toml b/test_programs/execution_success/regression_9455/Nargo.toml new file mode 100644 index 00000000000..2f7d38119ef --- /dev/null +++ b/test_programs/execution_success/regression_9455/Nargo.toml @@ -0,0 +1,8 @@ +[package] +name = "regression_9455" +type = "bin" +authors = [""] +compiler_unstable_features = ["enums"] + + +[dependencies] diff --git a/test_programs/execution_success/regression_9455/Prover.toml b/test_programs/execution_success/regression_9455/Prover.toml new file mode 100644 index 00000000000..35cafa07e2a --- /dev/null +++ b/test_programs/execution_success/regression_9455/Prover.toml @@ -0,0 +1 @@ +predicate = true diff --git a/test_programs/execution_success/regression_9455/src/main.nr b/test_programs/execution_success/regression_9455/src/main.nr new file mode 100644 index 00000000000..83ba3198e23 --- /dev/null +++ b/test_programs/execution_success/regression_9455/src/main.nr @@ -0,0 +1,6 @@ +unconstrained fn main(predicate: bool) { + let num1 = &mut 0; + let array = if predicate { [num1] } else { [num1] }; + *array[0] = 9; + assert_eq(*array[0], 9); +} diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__expanded.snap new file mode 100644 index 00000000000..3e149454769 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__expanded.snap @@ -0,0 +1,17 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main() { + let string: &mut str<4> = &mut "OOPS"; + let param: [&mut str<4>; 1] = [string]; + assert(*param[0_u32] == "OOPS"); + foo(param); + assert(*param[0_u32] == "GOOD"); +} + +fn foo(param: [&mut str<4>; 1]) { + let s: &mut str<4> = param[0_u32]; + *(s) = "GOOD"; + for _ in 0_u32..1_u32 {} +} diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..7de940827c8 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_9398/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,26 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [], + "return_type": null, + "error_types": {} + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : []", + "public parameters indices : []", + "return value indices : []" + ], + "debug_symbols": "XY5BCsQwCEXv4rqLWfcqw1BsaosgJtikMITefWyYQOlK/3/6tcJCc9km1jXuML4rzMYivE0SA2aO6m49B+hyykbkFty4byU00gyjFpEBDpTShvaE2mpGc/oagHTx6oErC13d+XGBge158UBjnIX+ci0abjR/Uyf942Qx0FKMrqTGPPsH", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__expanded.snap new file mode 100644 index 00000000000..f7d23c460a7 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__expanded.snap @@ -0,0 +1,12 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +unconstrained fn main(index: u32) { + let v0: &mut Field = &mut 1_Field; + let v1: &mut Field = &mut 2_Field; + let mut v3: [&mut Field; 1] = [v0]; + v3[index] = v1; + *(v3[index]) = 3_Field; + assert(*v3[index] == 3_Field); +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..4b19120d448 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,55 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, 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: 29 }, 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: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "dZBBDoMgEEXvMmsWSGttvYoxBnU0JAQNQpPGcPcOoq1ddDOPYfh/wl+hx9aPjTLDtEBZrdBapbUaGz110qnJ0O0KPJYshzJjkN0SioR7wmOD4AlZgiCEwODwapxFjFYnc1o5S4vGQWm81gyeUvvt0TJLs9FJS1POAE1PJMNBaYynwL5q/l9a5Lu2uH3EOalr6mSn7M9nQ/SxSrYa93bwpjtN3Ws+JkdYs5067L3F6HRKjGolrkw8aoqIQqkunF1EHeLqNw==", + "file_map": { + "50": { + "source": "unconstrained fn main(index: u32) {\n let v0 = &mut 1;\n let v1 = &mut 2;\n let mut v3 = [v0];\n v3[index] = v1;\n *v3[index] = 3;\n assert_eq(*v3[index], 3);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__stdout.snap new file mode 100644 index 00000000000..e86e3de90e1 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- + diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__expanded.snap new file mode 100644 index 00000000000..80730997cf4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__expanded.snap @@ -0,0 +1,14 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +unconstrained fn main(n: u32) { + let num1: &mut Field = &mut 0_Field; + let mut slice: [&mut Field] = &[]; + for _ in 0_u32..n { + slice = slice.push_back(num1); + } + *(slice[0_u32]) = 9_Field; + assert(*slice[0_u32] == 9_Field); + assert(*num1 == 9_Field); +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..63506f80325 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,59 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "n", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "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 : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 89 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, 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(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, Store { destination_pointer: Relative(5), source: Relative(6) }, Mov { destination: Relative(7), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(4) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 1 }, Mov { destination: Relative(2), source: Relative(6) }, Jump { location: 41 }, BinaryIntOp { destination: Relative(8), op: LessThan, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(8), location: 66 }, Jump { location: 44 }, Load { destination: Relative(1), source_pointer: Relative(5) }, Load { destination: Relative(2), source_pointer: Relative(7) }, BinaryIntOp { destination: Relative(4), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(1) }, Const { destination: Relative(1), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(4), location: 50 }, Call { location: 95 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(4), source_pointer: Relative(5) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(4) }, BinaryFieldOp { destination: Relative(4), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(4), location: 60 }, Const { destination: Relative(5), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(5) } }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 65 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, Return, Load { destination: Relative(8), source_pointer: Relative(5) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Load { destination: Relative(10), source_pointer: Relative(9) }, Const { destination: Relative(11), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(12), op: Equals, bit_size: U32, lhs: Relative(11), rhs: Relative(10) }, Not { destination: Relative(12), source: Relative(12), bit_size: U1 }, JumpIf { condition: Relative(12), location: 74 }, Call { location: 98 }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(10), rhs: Direct(2) }, Store { destination_pointer: Relative(9), source: Relative(10) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(8), rhs: Direct(2) }, Mov { destination: Direct(32771), source: Relative(8) }, Mov { destination: Direct(32772), source: Relative(9) }, Const { destination: Direct(32773), bit_size: Integer(U32), value: 1 }, Call { location: 101 }, Mov { destination: Relative(12), source: Direct(32774) }, Mov { destination: Relative(13), source: Direct(32775) }, Store { destination_pointer: Relative(13), source: Relative(3) }, Store { destination_pointer: Relative(5), source: Relative(10) }, Store { destination_pointer: Relative(7), source: Relative(12) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(4) }, Mov { destination: Relative(2), source: Relative(8) }, Jump { location: 41 }, 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: 94 }, 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: 14225679739041873922 }, 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(32776), source_pointer: Direct(32772) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32772), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32777), op: Mul, bit_size: U32, lhs: Direct(32771), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, Load { destination: Direct(32778), source_pointer: Direct(32780) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32780), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32780), op: Add, bit_size: U32, lhs: Direct(32777), rhs: Direct(32773) }, BinaryIntOp { destination: Direct(32781), op: LessThanEquals, bit_size: U32, lhs: Direct(32780), rhs: Direct(32778) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32776), rhs: Direct(2) }, JumpIf { condition: Direct(32781), location: 112 }, Jump { location: 129 }, JumpIf { condition: Direct(32782), location: 114 }, Jump { location: 118 }, Mov { destination: Direct(32774), source: Direct(32772) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, Jump { location: 128 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(32784) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32783) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32780) }, BinaryIntOp { destination: Direct(32783), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(2) }, Store { destination_pointer: Direct(32783), source: Direct(32778) }, Jump { location: 128 }, Jump { location: 141 }, Const { destination: Direct(32784), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(32783), op: Mul, bit_size: U32, lhs: Direct(32780), rhs: Direct(32784) }, Const { destination: Direct(32785), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32783), rhs: Direct(32785) }, Mov { destination: Direct(32774), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32784) }, IndirectConst { destination_pointer: Direct(32774), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32780) }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32784), rhs: Direct(2) }, Store { destination_pointer: Direct(32784), source: Direct(32783) }, Jump { location: 141 }, Const { destination: Direct(32782), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(32781), op: Add, bit_size: U32, lhs: Direct(32774), rhs: Direct(32782) }, BinaryIntOp { destination: Direct(32782), op: Equals, bit_size: U32, lhs: Direct(32772), rhs: Direct(32774) }, JumpIf { condition: Direct(32782), location: 155 }, BinaryIntOp { destination: Direct(32784), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(32777) }, Mov { destination: Direct(32785), source: Direct(32779) }, Mov { destination: Direct(32786), source: Direct(32781) }, BinaryIntOp { destination: Direct(32787), op: Equals, bit_size: U32, lhs: Direct(32785), rhs: Direct(32784) }, JumpIf { condition: Direct(32787), location: 155 }, Load { destination: Direct(32783), source_pointer: Direct(32785) }, Store { destination_pointer: Direct(32786), source: Direct(32783) }, BinaryIntOp { destination: Direct(32785), op: Add, bit_size: U32, lhs: Direct(32785), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32786), op: Add, bit_size: U32, lhs: Direct(32786), rhs: Direct(2) }, Jump { location: 148 }, BinaryIntOp { destination: Direct(32775), op: Add, bit_size: U32, lhs: Direct(32781), rhs: Direct(32777) }, Return]" + ], + "debug_symbols": "ndTLioMwGAXgd8naRS7m1lcppVibDkJQSXVgKL77/MnRXhYDg5t+VXNOQlPzYNdwmb/OXX8b7uxwfLBL6mLsvs5xaJupG3q6+2A8fwjNDqJiwgALHPAFyYEAEihQA7RItEi0SLRItCi0KLQotCi0KLQotCi0KLTUFJAEDVGEBjSkJixwwBc0TaQJASRQoAbUYghqsYQFDviC4YBaHCGBAjUwZWXGAgd8wXKAxVsJFKiBBtTiCQsc8AXHgQASKFADDXLLslRs2+HzlELIG/y25fRHGJsU+okd+jnGin03cS6D7mPTF6cm0VNesdBfSSq8dTHkb0v1SvO/o1quWa2eYf3vtDdr2tsdaWHEGhdG7snrbXqhd82v+TPv9uSt3/Ju1/zWbXnPd+Qlt2teCr1nfvH8/ZT4yJ/oqmm79HEALbkpdc0lhvXyNvft29PpZ9yebAfYmIY2XOcUctPrFKN34Si4qGgHT3Ru0b2j85Wv8wW9PEfvKsH5ackr+QU=", + "file_map": { + "50": { + "source": "unconstrained fn main(n: u32) {\n let num1 = &mut 0;\n let mut slice = &[];\n for _ in 0..n {\n slice = slice.push_back(num1);\n }\n *slice[0] = 9;\n assert_eq(*slice[0], 9);\n assert_eq(*num1, 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__stdout.snap new file mode 100644 index 00000000000..e86e3de90e1 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9439/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- + diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__expanded.snap new file mode 100644 index 00000000000..c07acc57f49 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__expanded.snap @@ -0,0 +1,10 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +unconstrained fn main(predicate: bool) { + let num1: &mut Field = &mut 0_Field; + let array: [&mut Field; 1] = if predicate { [num1] } else { [num1] }; + *(array[0_u32]) = 9_Field; + assert(*array[0_u32] == 9_Field); +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..dcd945d26f4 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,53 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "predicate", + "type": { + "kind": "boolean" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "12049594436772143978": { + "error_kind": "string", + "string": "array ref-count underflow detected" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, 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: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 51 }, Mov { destination: Relative(3), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(4), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(3), source: Relative(4) }, Mov { destination: Relative(4), source: Direct(1) }, Const { destination: Relative(5), bit_size: Integer(U32), value: 2 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(5) }, IndirectConst { destination_pointer: Relative(4), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Mov { destination: Relative(6), source: Relative(5) }, Store { destination_pointer: Relative(6), source: Relative(3) }, JumpIf { condition: Relative(1), location: 30 }, Jump { location: 28 }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Load { destination: Relative(1), source_pointer: Relative(4) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 36 }, Call { location: 57 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Mov { destination: Relative(2), source: Relative(4) }, Jump { location: 40 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(2), rhs: Relative(1) }, Load { destination: Relative(3), source_pointer: Relative(4) }, Const { destination: Relative(1), bit_size: Field, value: 9 }, Store { destination_pointer: Relative(3), source: Relative(1) }, Load { destination: Relative(2), source_pointer: Relative(3) }, BinaryFieldOp { destination: Relative(3), op: Equals, lhs: Relative(2), rhs: Relative(1) }, JumpIf { condition: Relative(3), location: 50 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(4) } }, 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: 56 }, 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]" + ], + "debug_symbols": "nZLBjoMgEIbfhTMHYYC2vkpjDCo2JAQN1U02xnffwdGuPWyy6YVP5P8Gx8zCOtfMj9rHfniy8r6wJvkQ/KMOQ2snP0R8u7AiL0KzUnAmDOFCuBJuG2RBEARJAIIiUBWgJFASKAmUBErCnqT7gO5T6EmEIEgCEBQBPUCgpxAXwpWA36nWlbOjvXpKzuXuTv3iXxhtcnFiZZxD4OzLhnkLPUcbN0424WnBmYsdEgv2Prj8tPJfu/hbNWJ3jXzJ+t+2kGbXBahPfK0P38BHvnr55s2vcGdbn97mZ82VkrdNcPu2n2N7Op2+x+PkmL8xDa3r5uRypdMQ4nrXgmtT4dSJvLlwfavWfPUP", + "file_map": { + "50": { + "source": "unconstrained fn main(predicate: bool) {\n let num1 = &mut 0;\n let array = if predicate { [num1] } else { [num1] };\n *array[0] = 9;\n assert_eq(*array[0], 9);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__stdout.snap new file mode 100644 index 00000000000..e86e3de90e1 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9455/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- +