Skip to content

Commit 9ee9943

Browse files
committed
dfa: disable if size limit is 0
As a special case, if the user configures a DFA size limit of 0, then we should never try to use it. This avoids a bit of thrashing where the DFA tries to senselessly run before spilling over to the NFA.
1 parent 3182b23 commit 9ee9943

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dfa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn can_exec(insts: &Program) -> bool {
7171
// If i32::MAX is the largest positive delta,
7272
// then -i32::MAX == i32::MIN + 1 is the largest negative delta,
7373
// and we are OK to use 32 bits.
74-
if insts.len() > ::std::i32::MAX as usize {
74+
if insts.dfa_size_limit == 0 || insts.len() > ::std::i32::MAX as usize {
7575
return false;
7676
}
7777
for inst in insts {

0 commit comments

Comments
 (0)