Skip to content

Commit

Permalink
fix a crash in stack and dump
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Dec 5, 2023
1 parent d692e7f commit 5897bc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,10 @@ fn stack_boundaries(env: &Uiua) -> Vec<(usize, &FunctionId)> {
}
let sig = frame.function.signature();
height = height.max(((sig.args as isize) - reduced).max(0) as usize);
boundaries.push((env.stack_height() - height, &frame.function.id));
boundaries.push((
env.stack_height().saturating_sub(height),
&frame.function.id,
));
}
boundaries
}
Expand Down

0 comments on commit 5897bc8

Please sign in to comment.