Skip to content

Commit

Permalink
Add location information to memoryop
Browse files Browse the repository at this point in the history
  • Loading branch information
guipublic committed Aug 2, 2023
1 parent 940b189 commit ccb6a02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crates/nargo_cli/src/cli/execute_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ fn extract_unsatisfied_constraint_from_nargo_error(nargo_err: &NargoError) -> Op
};

match solving_err {
acvm::pwg::OpcodeResolutionError::UnsatisfiedConstrain { opcode_label } => {
acvm::pwg::OpcodeResolutionError::IndexOutOfBounds { opcode_label, .. }
| acvm::pwg::OpcodeResolutionError::UnsatisfiedConstrain { opcode_label } => {
match opcode_label {
OpcodeLabel::Unresolved => {
unreachable!("Cannot resolve index for unsatisfied constraint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ impl AcirContext {

// Add the memory read operation to the list of opcodes
let op = MemOp::read_at_mem_index(index_witness.into(), value_read_witness);
self.acir_ir.opcodes.push(Opcode::MemoryOp { block_id, op });
self.acir_ir.push_opcode(Opcode::MemoryOp { block_id, op });

Ok(value_read_var)
}
Expand All @@ -1081,7 +1081,7 @@ impl AcirContext {

// Add the memory write operation to the list of opcodes
let op = MemOp::write_to_mem_index(index_witness.into(), value_write_witness.into());
self.acir_ir.opcodes.push(Opcode::MemoryOp { block_id, op });
self.acir_ir.push_opcode(Opcode::MemoryOp { block_id, op });
Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl GeneratedAcir {
}

/// Adds a new opcode into ACIR.
fn push_opcode(&mut self, opcode: AcirOpcode) {
pub(crate) fn push_opcode(&mut self, opcode: AcirOpcode) {
self.opcodes.push(opcode);
if let Some(location) = self.current_location {
self.locations.insert(self.opcodes.len() - 1, location);
Expand Down

0 comments on commit ccb6a02

Please sign in to comment.