Skip to content

Commit

Permalink
fix: Update array type when processing staged memory (#1751)
Browse files Browse the repository at this point in the history
Update array type when processing staged memory
  • Loading branch information
guipublic authored Jun 19, 2023
1 parent a3a824c commit 27eb748
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions crates/noirc_evaluator/src/ssa/acir_gen/acir_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ struct ArrayHeap {

impl ArrayHeap {
fn commit_staged(&mut self) {
for (idx, (value, op)) in &self.staged {
let item = MemOp {
operation: op.clone(),
value: value.clone(),
index: Expression::from_field(FieldElement::from(*idx as i128)),
};
self.trace.push(item);
// generates the memory operations to be added to the trace
let trace = vecmap(&self.staged, |(idx, (value, op))| MemOp {
operation: op.clone(),
value: value.clone(),
index: Expression::from_field(FieldElement::from(*idx as i128)),
});
// Add to trace
for item in trace {
self.push(item);
}
self.staged.clear();
}
Expand Down

0 comments on commit 27eb748

Please sign in to comment.