Skip to content

carry trailing high surrogate across CodePointBuffer appends#4943

Open
rootvector2 wants to merge 1 commit into
antlr:devfrom
rootvector2:split-surrogate-pair-append
Open

carry trailing high surrogate across CodePointBuffer appends#4943
rootvector2 wants to merge 1 commit into
antlr:devfrom
rootvector2:split-surrogate-pair-append

Conversation

@rootvector2

Copy link
Copy Markdown

appendArrayInt emitted a chunk-trailing high surrogate immediately instead of holding it in prevHighSurrogate, so a surrogate pair split across two append() calls (e.g. CharStreams.fromReader filling its read buffer mid-emoji) decoded to a spurious lone surrogate before the real code point; found tracing the chunked decode path, the fix keeps it pending for the next append() and flushes a still-dangling one in build().

Signed-off-by: rootvector2 <dxbnaveed.k@gmail.com>
@rootvector2

Copy link
Copy Markdown
Author

the failing typescript check is unrelated to this change. the whole runtime suite fails to compile with TS2591: Cannot find name 'process' (missing @types/node); the java build and the new test are green. happy to rebase if that job gets sorted on dev.

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