Skip to content

Fix: Handle large reverse-search limits without integer overflow - #347

Merged
ashvardanian merged 1 commit into
ashvardanian:main-devfrom
grouville:fix-reverse-search-overflow
Oct 18, 2026
Merged

ashvardanian merged 1 commit into
ashvardanian:main-devfrom
grouville:fix-reverse-search-overflow

Conversation

@grouville

@grouville grouville commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Guard reverse-search bounds before addition so large positions cannot wrap.

Consolidate the overflow regressions and the recently merged empty-search checks in the existing STL compatibility tests, which exercise both standard-library and StringZilla string types.

Validation: the STL read tests pass in C++11 and C++20. Rebased onto current main-dev to resolve the conflict.

@grouville grouville changed the title Fix: Clamp reverse-search limits before arithmetic Fix: Handle large reverse-search limits without integer overflow Oct 8, 2026
@grouville
grouville force-pushed the fix-reverse-search-overflow branch from b36fd74 to b8a2c04 Compare October 8, 2026 09:05
@ashvardanian
ashvardanian force-pushed the fix-reverse-search-overflow branch 2 times, most recently from 8e118a9 to 9569caf Compare October 18, 2026 21:27
@ashvardanian
ashvardanian changed the base branch from main to main-dev October 18, 2026 21:27
Guard reverse-search bounds before addition to prevent unsigned overflow. Consolidate the boundary and empty-search regressions in the shared STL compatibility tests.
@ashvardanian
ashvardanian force-pushed the fix-reverse-search-overflow branch from 9569caf to 3aa6ae8 Compare October 18, 2026 21:34
@ashvardanian
ashvardanian merged commit 1b9b0a5 into ashvardanian:main-dev Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants