mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
fix(lib): return early for empty predicate step slice
(cherry picked from commit 31b9717ca3)
This commit is contained in:
parent
69723ca40e
commit
b0a6bde2fb
|
|
@ -2978,9 +2978,7 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
|
|||
) {
|
||||
Slice slice = self->patterns.contents[pattern_index].predicate_steps;
|
||||
*step_count = slice.length;
|
||||
if (self->predicate_steps.contents == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (slice.length == 0) return NULL;
|
||||
return &self->predicate_steps.contents[slice.offset];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue