Skip to content

fix(wasm): load supertype tables for ABI 15 grammars#5606

Merged
maxbrunsfeld merged 1 commit into
release-0.26from
backport-5605-to-release-0.26
May 18, 2026
Merged

fix(wasm): load supertype tables for ABI 15 grammars#5606
maxbrunsfeld merged 1 commit into
release-0.26from
backport-5605-to-release-0.26

Conversation

@tree-sitter-ci-bot

Copy link
Copy Markdown

Description

Backport of #5605 to release-0.26.

The wasm store gated supertype_symbols / supertype_map_slices /
supertype_map_entries copies on abi_version > LANGUAGE_VERSION_WITH_RESERVED_WORDS,
but every other consumer (language.c, query.c) treats those tables as
present when abi_version >= LANGUAGE_VERSION_WITH_RESERVED_WORDS.

A Wasm grammar built at ABI exactly 15 with supertype_count > 0 ends up
with supertype_count copied into the native TSLanguage but supertype_map_slices
left NULL. ts_query__analyze_patterns then calls ts_language_subtypes,
which dereferences self->supertype_map_slices[supertype] and crashes.

(cherry picked from commit a53c3b0)
@maxbrunsfeld maxbrunsfeld merged commit 7aea015 into release-0.26 May 18, 2026
14 checks passed
@maxbrunsfeld maxbrunsfeld deleted the backport-5605-to-release-0.26 branch May 18, 2026 20:58
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