Skip to content

Commit

Permalink
Revert "fix: correct result when assigning shared arrays in unconstra…
Browse files Browse the repository at this point in the history
…ined code (#4210)"

This reverts commit bdd8a96.
  • Loading branch information
sirasistant committed Feb 12, 2024
1 parent fc32703 commit 0d874b5
Show file tree
Hide file tree
Showing 6 changed files with 1 addition 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.

0 comments on commit 0d874b5

Please sign in to comment.