Skip to content

Fix transformer state after short source input - #2

Closed
Richy-Z wants to merge 1 commit into
mxmCherry:mainfrom
Richy-Z:codex/fix-transformer-state
Closed

Richy-Z wants to merge 1 commit into
mxmCherry:mainfrom
Richy-Z:codex/fix-transformer-state

Conversation

@Richy-Z

@Richy-Z Richy-Z commented Oct 6, 2026

Copy link
Copy Markdown

The transformer retained trie traversal state after returning transform.ErrShortSrc even though it reported zero source bytes consumed. On the next call it resumed from that state without retaining the previous match, which could drop output or panic when the follow-up source was empty.

This makes each Transform call reconsider its supplied source, handles an empty final source, and adds regression coverage for both behaviours.

Verification: go test ./...

@Richy-Z Richy-Z closed this Oct 6, 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.

1 participant