Skip to content

Commit 4b5c217

Browse files
committed
vm core: add update_registers method
1 parent f5ef3f5 commit 4b5c217

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

crates/leanVm/src/core.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@ impl VirtualMachine {
105105

106106
Ok(())
107107
}
108+
109+
/// Updates the program counter and frame pointer based on the executed instruction.
110+
fn update_registers<F>(
111+
&mut self,
112+
instruction: &Instruction<F>,
113+
) -> Result<(), VirtualMachineError<F>>
114+
where
115+
F: PrimeField64,
116+
{
117+
// Update the program counter.
118+
self.update_pc(instruction)?;
119+
// Update the frame pointer.
120+
self.update_fp(instruction)?;
121+
122+
Ok(())
123+
}
108124
}
109125

110126
#[cfg(test)]

0 commit comments

Comments
 (0)