Skip to content

[ty] Check packed AST index bounds - #27849

Merged
charliermarsh merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/check-ast-index-bounds
Aug 18, 2026
Merged

charliermarsh merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/check-ast-index-bounds

Conversation

@zaniebot

Copy link
Copy Markdown
Contributor

An out-of-range NodeIndex in the final packed chunk can read padding instead of rejecting the lookup. That padding can decode to an address and node kind that were never recorded together, violating the invariant used to reconstruct an AST reference.

Check the chunk's actual entry count before decoding either representation, so invalid lookups fail before reconstructing a reference.

@astral-sh-bot

astral-sh-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@charliermarsh

Copy link
Copy Markdown
Member

Thank you, will take this.

@charliermarsh
charliermarsh marked this pull request as ready for review August 18, 2026 23:11
@charliermarsh
charliermarsh requested a review from a team as a code owner August 18, 2026 23:11
@astral-sh-bot
astral-sh-bot Bot requested a review from MichaReiser August 18, 2026 23:12
@charliermarsh
charliermarsh requested review from charliermarsh and removed request for MichaReiser August 18, 2026 23:12
@charliermarsh

Copy link
Copy Markdown
Member

LGTM.

@charliermarsh
charliermarsh merged commit 49bf50b into astral-sh:main Aug 18, 2026
104 of 105 checks passed
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