Skip to content

Commit

Permalink
fix(visual): drop leading 0's from clk when printing VM state
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Jan 11, 2024
1 parent 8510257 commit d1a61b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions triton-vm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ impl Display for VMState {
};
let multi_register = |regs: [_; 4]| regs.map(register).join(" | ");

writeln!(f)?;
writeln!(f, " ╭─{:─<tab_width$}─╮", "")?;
writeln!(f, " │ {: <tab_width$} │", format!("{instruction}"))?;
writeln!(
Expand All @@ -948,6 +949,7 @@ impl Display for VMState {
let jsd = register(JSD);
let osp = register(OpStackPointer);
let clk = row[CLK.base_table_index()].to_string();
let clk = clk.trim_start_matches('0');

let first_line = format!("ip: {ip} ╷ ci: {ci} ╷ nia: {nia} │ {clk: >clk_width$}");
print_row(f, first_line)?;
Expand Down

0 comments on commit d1a61b1

Please sign in to comment.