Skip to content

Commit

Permalink
automata: fix sparse DFA state validation in no-std
Browse files Browse the repository at this point in the history
The verified set isn't tracked in no-std/no-alloc because it is probably
not worth doing (and bloating the size of the sparse DFA itself to store
the state IDs).

So when we deserialize a DFA without std enabled, the verified set of
states was always reporting `false`, and this now trips an error 100% of
the time in the new start state validation code.

We fix this by always reporting `true`, thus treating every possible
state ID as possibly valid on its own. Not great, but maintains the
status quo.
  • Loading branch information
BurntSushi committed Oct 9, 2023
1 parent 452bc32 commit a2a1986
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion regex-automata/src/dfa/sparse.rs
Expand Up @@ -2540,7 +2540,7 @@ impl Seen {
}
fn insert(&mut self, _id: StateID) {}
fn contains(&self, _id: &StateID) -> bool {
false
true
}
}

Expand Down

0 comments on commit a2a1986

Please sign in to comment.