Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dense and sparse
from_bytesdon't check the universal start state IDs against the start table. sparseStartTable::validatenever looks at them, and dense only checks that they're in bounds. a DFA only has a universal start state when every look-behind context maps to the same start state, andfind_fwd_imp/find_rev_impuseuniversal_start_state().is_some()to skipprefilter_restartafter a prefilter candidate. so a deserialized dense DFA for(?-u:\b)foowith a forged universal start, afterset_prefilterwith a prefilter forfoo, reports a match ending at 4 inxfoo fooinstead of 8. the dense universal start can also be a match state, and the sparse one can point into the middle of a state, wherenext_statepanics with a subtraction overflow. this requires each universal start to equal every start table entry for its anchor mode in bothStartTable::validateimpls, which also makes it a valid non-match state, and adds a regression test to each of the dense and sparse unit tests.