fix(generate): assert there is a Nfa last state before retrieving it

Prevents unsigned subtraction wrapping antics in release builds
This commit is contained in:
Will Lillis 2025-09-16 03:23:22 -04:00
parent c54bc441ba
commit 31ff62445b

View file

@ -434,6 +434,7 @@ impl Nfa {
}
pub fn last_state_id(&self) -> u32 {
assert!(!self.states.is_empty());
self.states.len() as u32 - 1
}
}