We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e43ed77 commit 9fc0ac8Copy full SHA for 9fc0ac8
src/dfa.rs
@@ -66,9 +66,12 @@ use sparse::SparseSet;
66
pub fn can_exec(insts: &Program) -> bool {
67
use prog::Inst::*;
68
// If for some reason we manage to allocate a regex program with more
69
- // than u32::MAX instructions, then we can't execute the DFA because we
70
- // use 32 bit instruction pointers for memory savings.
71
- if insts.len() > ::std::u32::MAX as usize {
+ // than i32::MAX instructions, then we can't execute the DFA because we
+ // use 32 bit instruction pointer deltas for memory savings.
+ // If i32::MAX is the largest positive delta,
72
+ // then -i32::MAX == i32::MIN + 1 is the largest negative delta,
73
+ // and we are OK to use 32 bits.
74
+ if insts.len() > ::std::i32::MAX as usize {
75
return false;
76
}
77
for inst in insts {
0 commit comments