Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dfa: fix bug in how the reverse DFA is called
In turns out that in *some* calls to Fsm::reverse, we were passing an incorrect start offset. Namely, the haystack we pass is sub-sliced at `&text[start..]`, but in some places, we were passing `text.len()` as the start offset of the reverse search. But of course, it should be `text.len() - start`. This was indeed the case in most places, but it looks like it needed to be corrected in two additional places. I've also added this test to regex-automata's set of regression tests and can confirm that it doesn't happen there. (regex-automata is far more principled about handling offsets like this.) Fixes #969
- Loading branch information