mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
Change explain indent count to saturating sub in cli/app.rs to prevent overflow
This commit is contained in:
parent
95d10ce047
commit
2a415ebdb9
1 changed files with 2 additions and 2 deletions
|
|
@ -883,13 +883,13 @@ impl Limbo {
|
|||
}
|
||||
|
||||
match curr_insn {
|
||||
"Next" | "SorterNext" | "Prev" => indent_count - 1,
|
||||
"Next" | "SorterNext" | "Prev" => indent_count.saturating_sub(1),
|
||||
"Return" => {
|
||||
let matching_begin_subrtn =
|
||||
unclosed_begin_subrtns.iter().position(|b| b == p1);
|
||||
if let Some(matching_begin_subrtn) = matching_begin_subrtn {
|
||||
unclosed_begin_subrtns.remove(matching_begin_subrtn);
|
||||
indent_count - 1
|
||||
indent_count.saturating_sub(1)
|
||||
} else {
|
||||
indent_count
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue