Fix crash on unterminated alternation in query

Fixes #968
This commit is contained in:
Max Brunsfeld 2021-03-07 08:48:03 -08:00
parent f18c36ca62
commit 5a2534ac4a
2 changed files with 13 additions and 0 deletions

View file

@ -1541,6 +1541,7 @@ static TSQueryError ts_query__parse_pattern(
stream_advance(stream);
break;
} else if (e) {
if (e == PARENT_DONE) e = TSQueryErrorSyntax;
array_delete(&branch_step_indices);
return e;
}