Skip to content

[WATParser] Do not advance position on unterminated block comments - #9142

Open
tlively wants to merge 1 commit into
mainfrom
fix-8634-1
Open

tlively wants to merge 1 commit into
mainfrom
fix-8634-1

Conversation

@tlively

@tlively tlively commented Sep 23, 2026

Copy link
Copy Markdown
Member

When an unterminated block comment directly followed an annotation and ended with whitespace, Lexer::takeComment advanced pos to the last character of the buffer without restoring startPos. Because takeComment returned false after takeAnnotation returned true, skipSpace terminated with pos pointing at the trailing whitespace instead of the start of the unterminated comment, causing mismatched implicit type positions between parsing phases.

Fixes #8634.

When an unterminated block comment directly followed an annotation and ended with whitespace, Lexer::takeComment advanced pos to the last character of the buffer without restoring startPos. Because takeComment returned false after takeAnnotation returned true, skipSpace terminated with pos pointing at the trailing whitespace instead of the start of the unterminated comment, causing mismatched implicit type positions between parsing phases.

Fixes #8634.
@tlively
tlively requested a review from a team as a code owner September 23, 2026 03:05
@tlively
tlively requested review from stevenfontanella and removed request for a team September 23, 2026 03:05

This branch has not been deployed

No deployments
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.

Assertion failure it != implicitTypes.end() in wasm::WATParser::ParseModuleTypesCtx::makeTypeUse at contexts.h:1474 (main branch @3ef8d19)

1 participant