Skip to content

Commit

Permalink
fix: Revert "correct result when assigning shared arrays" and added r…
Browse files Browse the repository at this point in the history
…egression test (#4333)

# Description

## Problem\*

Resolves: #4332

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
sirasistant committed Feb 12, 2024
1 parent fc32703 commit 05e78b3
Show file tree
Hide file tree
Showing 9 changed files with 414 additions and 39 deletions.
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/function_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ impl FunctionBuilder {
}
}
Type::Array(..) | Type::Slice(..) => {
self.insert_instruction(Instruction::IncrementRc { value }, None);
// If there are nested arrays or slices, we wait until ArrayGet
// is issued to increment the count of that array.
self.insert_instruction(Instruction::IncrementRc { value }, None);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ impl<'a> FunctionContext<'a> {
new_value.for_each(|value| {
let value = value.eval(self);
array = self.builder.insert_array_set(array, index, value);
self.builder.increment_array_reference_count(array);
index = self.builder.insert_binary(index, BinaryOp::Add, one);
});
array
Expand Down
5 changes: 0 additions & 5 deletions compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,6 @@ impl<'a> FunctionContext<'a> {
let lhs = self.extract_current_value(&assign.lvalue)?;
let rhs = self.codegen_expression(&assign.expression)?;

rhs.clone().for_each(|value| {
let value = value.eval(self);
self.builder.increment_array_reference_count(value);
});

self.assign_new_value(lhs, rhs);
Ok(Self::unit_value())
}
Expand Down
7 changes: 0 additions & 7 deletions test_programs/execution_success/brillig_cow_assign/Nargo.toml

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions test_programs/execution_success/brillig_cow_assign/src/main.nr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "brillig_cow_regression"
type = "bin"
authors = [""]

[dependencies]
229 changes: 229 additions & 0 deletions test_programs/execution_success/brillig_cow_regression/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
[kernel_data]
encrypted_logs_hash = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_commitments = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_l2_to_l1_msgs = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_nullifiers = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
unencrypted_logs_hash = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]

[[kernel_data.new_contracts]]
contract_address = "0x0000000000000000000000000000000000000000000000000000000000000000"
portal_contract_address = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

0 comments on commit 05e78b3

Please sign in to comment.