Skip to content

fix: KMP fallback branch updating matchStart with wrong matchPos value#1

Open
cesco69 wants to merge 1 commit intoalmost:masterfrom
cesco69:master
Open

fix: KMP fallback branch updating matchStart with wrong matchPos value#1
cesco69 wants to merge 1 commit intoalmost:masterfrom
cesco69:master

Conversation

@cesco69
Copy link
Copy Markdown

@cesco69 cesco69 commented Apr 30, 2026

The KMP fallback branch in the transform function updated matchPos before using its old value to compute matchStart, causing incorrect match positioning when the search pattern has overlapping prefixes and input is split across chunks.

This went unnoticed because existing tests only exercised this path with single-chunk input. Added regression tests that split overlapping-prefix patterns across multiple writes, which fail without the fix.

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.

1 participant