mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
fix(wasm): load supertype tables for ABI 15 grammars (#5605)
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.
This commit is contained in:
parent
f535c3bb97
commit
a53c3b03a0
|
|
@ -1325,7 +1325,7 @@ const TSLanguage *ts_wasm_store_load_language(
|
|||
}
|
||||
|
||||
bool has_supertypes =
|
||||
wasm_language.abi_version > LANGUAGE_VERSION_WITH_RESERVED_WORDS &&
|
||||
wasm_language.abi_version >= LANGUAGE_VERSION_WITH_RESERVED_WORDS &&
|
||||
wasm_language.supertype_count > 0;
|
||||
|
||||
int32_t addresses[] = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue