Fix invalid read by query cursor on error nodes
🎩 @bfredl Refs https://github.com/tree-sitter/tree-sitter/pull/448#issuecomment-536337749
This commit is contained in:
parent
d40f3b96b6
commit
cb87b7b76e
1 changed files with 4 additions and 1 deletions
|
|
@ -1006,7 +1006,10 @@ static inline bool ts_query_cursor__advance(TSQueryCursor *self) {
|
|||
&can_have_later_siblings_with_this_field
|
||||
);
|
||||
TSNode node = ts_tree_cursor_current_node(&self->cursor);
|
||||
TSSymbol symbol = self->query->symbol_map[ts_node_symbol(node)];
|
||||
TSSymbol symbol = ts_node_symbol(node);
|
||||
if (symbol != ts_builtin_sym_error) {
|
||||
symbol = self->query->symbol_map[symbol];
|
||||
}
|
||||
|
||||
// If this node is before the selected range, then avoid descending
|
||||
// into it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue