<functional>: boyer_moore_searcher stores Delta2 using _Iter_diff_t<_RanItPat>, which might not be able to store the maximum shift
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Describe the bug
If the user creates a boyer_moore_searcher with iterator types where difference_type is char, they can supply a pattern of length CHAR_MAX, which might have a maximum delta2 shift of 2 times its length. However, we store _Diffs for this table, so that value may be unrepresentable.
We probably should always use size_t instead.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the boyer_moore_searcher implementation and how its Delta2 table stores _Diff values. Confirm the CHAR_MAX pattern case and the maximum shift, then check the vNext branch guidance; done means the shift is representable without overflow while accounting for the required binary-compatibility break.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100